开发者

SysUtils.StrScan() function for string type? where?

开发者 https://www.devze.com 2023-01-15 13:13 出处:网络
While SysUtils.StrScan() takes PWideChar开发者_Go百科 const as the parameter, is there a StrScan() like built-in function for string/Unicodestring type?

While SysUtils.StrScan() takes PWideChar开发者_Go百科 const as the parameter, is there a StrScan() like built-in function for string/Unicodestring type?

Thanks in advance.


Plain old Pos will work well enough for most cases. The second parameter will simply be a one-character string instead of a Char.

If the string you're searching through will not have embedded null characters, then you can also use StrScan directly; just type-cast the string parameter to PChar. StrScan will stop searching when it reaches the null character.

0

精彩评论

暂无评论...
验证码 换一张
取 消