delphi中如何分割字符串
我只需要将 "STANS", "Payment, chk#1", ,1210.000
这样的字符串拆分为基于 ,
的数组。字符串列表中的结果将是
STANS
Payment, chk#1
1210.000
I just need to split a string like: "STANS", "Payment, chk#1", ,1210.000
into an array based on ,
. The result in the string list would be
STANS
Payment, chk#1
1210.000
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个
TStringList
并将逗号分隔的字符串分配给StringList.CommaText
。这会解析您的输入并将分割的字符串作为字符串列表的项目返回。Create a
TStringList
and assign your comma separated string toStringList.CommaText
. This parses your input and returns the split strings as the items of the string list.我在 Delphi 2007 中编写了这个函数并且非常适合我
I wrote this function and works perfect for me in Delphi 2007