Reputation: 14148
In C#, what is the best way to parse the following string to capture the actual value "Yes
" ?
InnerText = "\nPer Diem Allowed\n Per Diem Allowed\n Yes\n
In other words, I want to detect the very last \n and capture the word what is before that.
Upvotes: 0
Views: 145
Reputation: 16399
string[] parts = InnerText.Split("\n".ToCharArray());
string partIWant = parts[parts.Length - 2];
Upvotes: 3