Delphi 2006 system.delete for widestrings?
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?
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.
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).
链接地址: http://www.djcxy.com/p/61484.html上一篇: Delphi中的宽字符串兼容性问题