4
Answers

Parsing line of text in C# with spaces

Ask a question
Jack

Jack

17y
2.4k
1
Hello!

I am trying to parse lines of text that are not tab or comma delimited. Once I have loaded the lines into an array I need to grab a number from the line to be able to use for another command. The line would look like this:

rdp-tcp#142       newuser                  1  Active  rdpwd

And I would need the 1 (or whatever integer is there). The spaces from the user to that may not always be the same (due to username).

How can I do this? Thanks much inadvance. Love this site!

Answers (4)