I am new to c# programming and I want to ask a question.
How can I get the value in () and store it in another string. example:
I have string
s1="here there (hi)";
How can I get
s2="hi";
the ()
will always be at the end of the sentence (never at first or in between).
string s1 = "abc (hi)";
string s2 = s1.Substring(s1.LastIndexOf("(") + 1, s1.LastIndexOf(")") - s1.LastIndexOf("(") - 1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With