62,253
社区成员
发帖
与我相关
我的任务
分享
string str="{#zhoulihgfdhg#}";
Regex re = new Regex("(?s)(?<={#).*?(?=#})");
string output = re.Match(str);
// output = "zhoulihgfdhg";
string str="{#zhoulihgfdhg#}";
int i = str.IndexOf("{#")+"{#".Length;
int j = str.IndexOf("#}");
string str1 = str.Substring(i, j-i);
//str1就是你想要的字符串了