Posted on: 1/16/2014 5:38:57 PM | Views : 572

my text file has format:
aaa bbb
ccc ddd
...
I use ReadAllLines method to read text file
string[] lines = File.ReadAllLines(file)
now I want to get bbb or ddd,
the statement:
lines[0].Split(' ')[1] to get bbb
lines[1].Split(' ')[1] to get ddd
do not work. Is some wrong here?

I can get aaa or ccc by change lines[0].Split(' ')[0] or lines[1].Split(' ')[0]

I use ' ' as a separtors to split a space. but between xxx and xxx there are 3 space characters.

Thanks.

Go to the complete details ...