Text = Mithesh Reddy, Hello
I need to get Reddy as my output from above text.
example
Text = hello how r u raj, where are u from?
expected result = raj
Text = Mithesh Reddy, Hello
I need to get Reddy as my output from above text.
example
Text = hello how r u raj, where are u from?
expected result = raj
System.Text.RegularExpressions.Regex.Match(Input,"[A-Za-z]+(?=\s*\,)").Value
Regards
Output:-

Regex:-
System.Text.RegularExpressions.Regex.Match(inputText, “\b\w+(?=,)”).Value
Xaml File:-
Main.xaml (7.2 KB)
If this works for you, please mark it as a solution, so others can refer the same. ![]()
Thanks
You can try the below syntax too
InputVar.Split(",").First.ToString.Split(" ").Last
Regards
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.