Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# string console readline array

string foo = Console.ReadLine();
string[] tokens = foo.Split(",");
List<int> nums = new List<int>();
int oneNum;
foreach(string s in tokens)
{
    if(Int32.TryParse(s, out oneNum))
        nums.Add(oneNum);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #console #readline #array
ADD COMMENT
Topic
Name
2+5 =