storing values from one textbox(with multiline set to true) to in array? c#

Ok so im bored again . :o

firstly , would you want to have a string[] "aka string array" or int[] "aka int array"
the key is in the detail ;)

forming a string [] is as simple as
Code:
string[] split = mail.Split(new char[] { '\n' });

for an int[] from multiline textbox you will need to do a conversion
from string[] to int[] like so and returning the int[] for you to work with it again

( :twisted: clean code helps you later in life :whistle:)

Code:
public int[] new_list(string[] split)
        {
            int[] list_new = new int[split.Length];

            for (int i = 0; i < split.Length; i++)
            {
                list_new[i] = Convert.ToInt32(split[i]);
            }

            return list_new;
        }

Hope this helps.
 
you should rather point a fella in the right direction rather than to give them the answer (especially if they are in school) although i doubt they learn webservices in school? :D
 
Yea , i actually should :D
You don't learn webservices in school nor do most ppl get to write in c# at school either.
 
Top
Sign up to the MyBroadband newsletter
X