0
I want to take the word "[email protected]" that’s inside that metromessagebox
I tried that, but it didn’t work out:
String[] palavra = ex.Message.Split(new String[] { "(", ")" }, StringSplitOptions.RemoveEmptyEntries);
0
I want to take the word "[email protected]" that’s inside that metromessagebox
I tried that, but it didn’t work out:
String[] palavra = ex.Message.Split(new String[] { "(", ")" }, StringSplitOptions.RemoveEmptyEntries);
0
There is no mystery, just capture the text inside the parentheses.
Regex
var s = Regex.Match(ex.Message, @"\(([^)]*)\)").Groups[1].Value;
Regex-free
string output = ex.Message.Split('(', ')')[1];
Browser other questions tagged c# .net string
You are not signed in. Login or sign up in order to post.
I can’t understand what you want to do. Want to get the last information in the message box or you have the text and want to see if it is contained in the message?
– Jéf Bueno
If you want to get the text of the message, probably you will have to use REGEX in what generates this message ai, is always this way?
– KhaosDoctor
people, is that type oq appears in the mesagebox is a string, I want to get what is between parentheses in this string, this messagebox I am treating the error and I do not want to appear that, I just want to appear the name of the field that the user placed.
– Kevin
And if there’s anything else in parentheses?
– Jéf Bueno
remembering what is between parentheses and a word varied, always changes....
– Kevin