Hi
Any way to get the substring with delimiter. like if string is 992.968.3.22, then getting 4 substrings 992, 968, 3 & 22.(here delimiter is ".")
Hi
Any way to get the substring with delimiter. like if string is 992.968.3.22, then getting 4 substrings 992, 968, 3 & 22.(here delimiter is ".")
Yes that is possible, you can use QStringList to hold the list of strings (sub-strings):
Qt Code:
QStringList list; list << str.split(".");To copy to clipboard, switch view to plain text mode
or you can use QString::section
Qt Code:
and so onTo copy to clipboard, switch view to plain text mode
p.s. split returns QStringList, that's why you can assign it right to stringlist, without operator <<
Qt Code:
To copy to clipboard, switch view to plain text mode
Septi (6th July 2010), tablebubble (8th July 2010), Zlatomir (6th July 2010)
@borisbn Good point with the split return type, thanks
tablebubble (8th July 2010)
Bookmarks