I have this Line C:\\pagefile.sys 128 256
and i need to get the value example:
label1.text = C:\\pagefile.sys
label2.Text = 128;
label3.text =
string[] temp = yourString.Split(' ');
label1.Text = temp[0];
label2.Text = temp[1];
label3.Text = temp[2];
You don't need to specify a whitespace character for Split
as that's the default if no characters are passed (or if null
is used). Split()
is the same as saying Split(new char[0]);
due to the params overloaded method.
string input = @"C:\pagefile.sys 128 256";
string[] splitString = input.Split();
label1.Text = splitString[0];
label2.Text = splitString[1];
label3.Text = splitString[2];