Hi
I have comma separated string and i want split that string.How it possible?.Example
aaaa,bbbb,cccc,ddd
i want output like
aaaa
bbbb
cccc
ddd
[import]uid: 209400 topic_id: 34796 reply_id: 334796[/import]
Hi
I have comma separated string and i want split that string.How it possible?.Example
aaaa,bbbb,cccc,ddd
i want output like
aaaa
bbbb
cccc
ddd
[import]uid: 209400 topic_id: 34796 reply_id: 334796[/import]
Here’s a bit of code that should do it:
[code]
local str=“aaaa,bbbb,cccc,ddd”;
local split = {};
local word;
for word in string.gmatch(str, “[^,]+”) do
print(word);
split[#split+1] = word; – save result in table
end
[/code] [import]uid: 70847 topic_id: 34796 reply_id: 138309[/import]
Thanks ,its working fine. [import]uid: 209400 topic_id: 34796 reply_id: 138311[/import]
Here’s a bit of code that should do it:
[code]
local str=“aaaa,bbbb,cccc,ddd”;
local split = {};
local word;
for word in string.gmatch(str, “[^,]+”) do
print(word);
split[#split+1] = word; – save result in table
end
[/code] [import]uid: 70847 topic_id: 34796 reply_id: 138309[/import]
Thanks ,its working fine. [import]uid: 209400 topic_id: 34796 reply_id: 138311[/import]