Delphi 2006 system.delete 宽字符串?
是否有可用于宽字符串的删除过程的对应项?或者我应该只使用复制并连接生成的 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
删除是一个“编译器魔法”功能。编译器利用其基本数据类型的知识来适当地处理操作。对于大多数数组,它可以简单地将您在代码中写入的信息转换为实际的偏移量和需要删除的字节数,并将其传递给
_Delete
汇编例程。对于 WideStrings,正如 Alexander 指出的,它有一个特殊的 _WStrDelete 例程。底线:如果您可以将数组或字符串传递给Delete并且它可以编译,那么它应该运行得很好。
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.
内部 RTL 函数(如删除、插入、长度等)适用于 Ansi 和 Wide 字符串。
例如,对 WideString 的删除调用会转换为 WStrDelete 调用(请参阅 System.pas)。
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).