Hi all,
is there a counterpart of the Delete procedure that could be used for widestrings? Or should I just use copy and concatenate the resulting WideStrings?
Hi all,
is there a counterpart of the Delete procedure that could be used for widestrings? Or should I just use copy and concatenate the resulting WideStrings?
Internal RTL functions like Delete, Insert, Length, etc works both for Ansi and Wide strings.
For example, Delete call on WideString is transformed into WStrDelete call (see System.pas).
Delete is a "compiler magic" function. The compiler uses its knowledge of the basic data type to handle the operation appropriately. For most arrays, it can simply translate the information you write in your code into the actual offset and number of bytes that need to be deleted, and passes that to the _Delete
assembly routine instead. For WideStrings, as Alexander pointed out, it's got a special _WStrDelete routine.
Bottom line: If you can pass an array or string to Delete and it compiles, it should run just fine.