I have the following string:
string test = /test/test1/tse3/ttese3/test3-45-NameToParseOut
and i need to parse out the word “NameToParseOut”. I basically need to find the last “-” and return all of the text after the last instance of “-“. What is the most elegant way of parsing this out in C#?
This works even for strings that do not contain dashes (in these cases the entire string is returned).