S
shapper
Hello,
I have a string as follows:
string text = "Paris, New York , London,Lisbon,Oslo, Chicago ";
I need to get all words with no commas or spaces:
"Paris", "New", "York", "London", "Lisbon", "Oslo", "Chicago"
I am using (I think it is ok):
string[] words = text.Split(new char[] { ',' , ' '})
I need to get 3 words of the all I got. It can be the first 3 or any
other 3. It does no matter.
So words would have, for example: "Paris", "New", "York"
Is there a way to do this without using a loop?
Thanks,
Miguel
I have a string as follows:
string text = "Paris, New York , London,Lisbon,Oslo, Chicago ";
I need to get all words with no commas or spaces:
"Paris", "New", "York", "London", "Lisbon", "Oslo", "Chicago"
I am using (I think it is ok):
string[] words = text.Split(new char[] { ',' , ' '})
I need to get 3 words of the all I got. It can be the first 3 or any
other 3. It does no matter.
So words would have, for example: "Paris", "New", "York"
Is there a way to do this without using a loop?
Thanks,
Miguel