How to split strings using regular expressions
The Regular Expressions Split() methods are almost similar to the String.Split() method, except that Regex.Split() method splits the string at a delimiter determined by a Regular Expression instead of a set of characters.
When using Regular Expressions you should use the following namespace in your project
string str = txtAddNumber.Text;
string result = Regex.Split(str, “\n\\s*”);
for (int i = 0; i < result.Length; i++)