string startstr = "BEGIN PUBLIC KEY-----";
string endstr = "-----END PUBLIC KEY";
int startindex, endindex;
//fileStringReader是要操作的字符串
startindex = fileStringReader.IndexOf(startstr);
string tmpstr = fileStringReader.Substring(startindex + startstr.Length);
endindex = tmpstr.IndexOf(endstr);
string result = tmpstr.Remove(endindex);
C# 截取指定字符串之间的字符串
最新推荐文章于 2024-04-04 08:24:20 发布