62,046
社区成员
发帖
与我相关
我的任务
分享
string str = "..bbs/default.aspx";
int num = str.LastIndexOf(".");
string Str1 = str.Substring(0,num);
string strRep = Str1.Replace("/", "_").Replace(".", "");
Response.Write("" + strRep + "");
void Main()
{
string s = "..bbs/default.aspx";
s = s.Replace("/", "_").Substring(2, s.LastIndexOf('.') - 2);
Console.WriteLine(s);
}
//结果:
bbs_default