Lazarus - 基于分隔符的解析函数
我正在 Lazarus 中构建一个小型应用程序,需要一个基于下划线的解析函数。例如:
array := Split(string, delimiter);
所以 string = "this_is_the_first_post"
和分隔符是下划线,导致数组返回为:
array[0] = this
array[1] = is
array[2] = the
array[3] = first
array[4] = post
任何人都知道如何解决这个问题吗?我尝试了一些代码示例,但它总是抛出错误。
谢谢。
I am building a small app in Lazarus and need a parse function based on the underscore. For example:
array := Split(string, delimiter);
So string = "this_is_the_first_post"
and delimiter is the underscore resulting in the array being returned as:
array[0] = this
array[1] = is
array[2] = the
array[3] = first
array[4] = post
Any one has any idea how to go about this? I have tried a few code examples and it always throws an error.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下代码:
在本示例中,输出将显示为一组消息,但您已经了解了总体思路。
You can use the following code:
In this example the output will be shown as a set of messages but you get the general idea.