I have a String, I want to use Linq to run a regex to shorten my string to a smaller substring that matches my ex case.
My code is currently giving an error
'char' does not contain a definition for 'Name' and no extension to the method 'Name' that takes the first argument of type 'char' can be found
My code is:
string variable = result.Name.Select(r => regEx.Match(r.Name).Groups[2].ToString());
Result.Name is the string contained in the user class.
What did I do wrong? What is wrong with my syntax / understanding?
source
share