Can anyone help with a little code i want to make array which first index will have first word of textbox text:
array[0] first word of text array[1] second word of text
can anyone help me?
Can anyone help with a little code i want to make array which first index will have first word of textbox text:
array[0] first word of text array[1] second word of text
can anyone help me?
string str = "Hello Word Hello" ;
var strarray = str.Split(' ') ;
You can replace the str with TextBox.Text...
Use the Split method of the string type.
It will split your string by a character specification to a string array (string[]).
For example:
textBox1.Text = "The world is full of fools";
string[] words = textBox1.Text.Split(' ');
foreach(string word in words)
{
//iterate your words here
}
use .Split() method like this:
var array = textboxText.Split(' ');