How to separate comma separated strings

Hi all,

I have a TString =“abc,def,ghi” and I want to break it into as many TStrings as elements between the commas, i.e. input= abc,def,ghi

output:
abc
def
ghi

I have gone as far as

TString input(“abc,def,ghi”);
TString output;
while(){
output.ReadToDelim(input, ‘,’:wink:
cout << output << ‘\n’;
}

But I don’t know how to:
-stop the while loop
-read the last bit after the last coma

Any help is greatly appreciated.

Thanks

Berta

Hi,

I actually have found that
Bool_t TString::Tokenize()
does the trick

Thanks

Berta