fill an array

  • Thread starter Thread starter klenne
  • Start date Start date
K

klenne

I have a .net question,

I have a textbox (multine = true) with data beneath each other:

4

0

6

3

...
I would like the data on top of the textbox (4) in a array at place 0,
de data below (0) to
place 1 of the Array, data below (6) to place 2 of the array,......

How can i program it?

KLenne
 
Hi KLenne,

I'm not exactly sure what you are asking, but in a textbox with a single
number on a line and white space between you can obtain a list of the
numbers like this

string[] lines = textBox1.Text.Split('\n');

ArrayList list = new ArrayList();

foreach (string s in lines)
{
string t = s.Trim();
if (t.Length > 0)
list.Add(t);
}
 
When you type a number in a textbox: number then backspace and the next
number. You get a textbox like tis:

4
2
1

A backspace is 2 karakters i think, how can I filter it and write the 4
in array place (0), the 2 in array place (1),..... it is a vb.net 2005
program

Greetz klenne
 
Its no longer needed, i found the solution somewhere else.

Thx for helping

In that case i would suggest you post the solution too.. This way people
after you can find the answer too...
 
Back
Top