How to create a list from a String

I have a string “bangalore mumbai delhi” etc. I want to write each city into a list/array based on new line seperator

@redwud800

Use : str.Split(" "c).ToList as shown below


Mukesh

2 Likes

Thanks…this works…
I also could do this using Matches…Regex.
used advanced option to configure regular expression

sir how can we convert this to list

question:-

Manoj
Sachin
prem

output:- {Manoj, Sachin, prem}