Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
convert a string of numbers to a list then use a forEach to loop through the list
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string numbers = "1,4,3,6,8,5,3,1,2,3,4"; List<int> numbersList = new List<int>( Array.ConvertAll(numbers.Split(','), int.Parse) ); numbersList.ForEach((item) => Console.WriteLine(item)); } } }
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
First Class
4.2 Casting
Raiz Cuadrada
Abstraction c#
Fibonacci Series
Helloworld
Testing 006
Class
Random number + IF var change2
HelloWorld
Please log in to post a comment.