I want to get the word "[email protected]" inside this MetroMessageBox
I tried this, but it did not work:
String[] palavra = ex.Message.Split(new String[] { "(", ")" }, StringSplitOptions.RemoveEmptyEntries);
I want to get the word "[email protected]" inside this MetroMessageBox
I tried this, but it did not work:
String[] palavra = ex.Message.Split(new String[] { "(", ")" }, StringSplitOptions.RemoveEmptyEntries);
There is no mystery, just capture the text inside the parentheses.
With regex
var s = Regex.Match(ex.Message, @"\(([^)]*)\)").Groups[1].Value;
No regex
string output = ex.Message.Split('(', ')')[1];