Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 = 256;

all values are variable, it is possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
221 views
Welcome To Ask or Share your Answers For Others

1 Answer

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];

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...