Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top