SysUtils.StrScan() 函数用于字符串类型?在哪里?

发布于 2024-09-18 10:19:08 字数 117 浏览 4 评论 0原文

虽然 SysUtils.StrScan() 采用 PWideChar const 作为参数,但是否有类似 StrScan() 的用于 string/Unicodestring 类型的内置函数?

提前致谢。

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

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白鸥掠海 2024-09-25 10:19:08

普通的旧式 Pos 对于大多数人来说已经足够好了案例。第二个参数只是一个单字符string,而不是Char

如果您要搜索的字符串没有嵌入空字符,那么您也可以直接使用 StrScan;只需将字符串参数类型转换为 PChar 即可。 StrScan 将在到达空字符时停止搜索。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文