怎么得到这个字符串中两个()之间的字符串

如何得到这个字符串中两个()之间的字符串
问个c语言最基础的问题. 

string StrCom = str2.substr(0,4); //str2是字符串"(com45)"
请问StrCom如何得到这个字符串中两个()之间的字符串?

------解决方案--------------------
string StrCom = str2.substr(1,5);
------解决方案--------------------
CString str=_T("(com4)");
str.Replace(_T("("),_T(""));
str.Replace(_T(")"),_T(""));

------解决方案--------------------
string StrCom = str2.substr(str2.Find('(') + 1,str2.Find(')') - str2.Find('(') - 1);

安全点你可以判断下 Find的返回值 或者用3楼的 不过你要考虑"(sa(asad)as)"等等这些情况下该怎么处理
------解决方案--------------------
引用:
CString str=_T("(com4)");
str.Replace(_T("("),_T(""));
str.Replace(_T(")"),_T(""));

如果括号左右还有东西,就不支持了。
大致这样就可以(假定字串是规则的,如果字串复杂,要加各种判断):
#include <string>

using namespace std;

int main()
{
    string xxx = "左边的(括号中的部分)右边的";
    int nLeft = xxx.find("(");
    int nRight = xxx.find(")");
    string result = string(xxx.c_str() + nLeft + 1, nRight - nLeft - 1);
    printf("%s\n", result.c_str());
}

------解决方案--------------------
支持楼上的做法
------解决方案--------------------
引用:
Quote: 引用:

CString str=_T("(com4)");
str.Replace(_T("("),_T(""));
str.Replace(_T(")"),_T(""));

如果括号左右还有东西,就不支持了。
大致这样就可以(假定字串是规则的,如果字串复杂,要加各种判断):
#include <string>

using namespace std;

int main()
{
    string xxx = "左边的(括号中的部分)右边的";
    int nLeft = xxx.find("(");