How to convert string to List of string in c#

the below value shoub be our requirements . then we need to convert that into list format.
String stt= "2, 4, 5, 6, 7";

List <string> listValues=stt. Split (', '). Select (Int. parse). ToList ();

o/p:
'--------
listValues = [ 2, 4, 5, 6, 7];

listValues [0]=2;

Comments

Popular posts from this blog

Reverse Sentence using c#

How to write Pure java script Program?