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 strings1="here there (hi)";
How can I get
开发者_如何学Cs2="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);
string s2 = s1.Substring(s1.LastIndexOf("(") + 1, s1.LastIndexOf(")") - s1.LastIndexOf("(") - 1);
 string e1 = "here there (hi)";
//Extraction 
 string s2 = e1.Substring(e1.IndexOf("(")+1, (e1.LastIndexOf(")") - e1.IndexOf("("))-1);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论