截取字符串的问题 string str = "Placeholder#ErrorMessege#Placeholder";请问如何截取其中的"ErrorMessege"? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string[] message=str.Split('#');string showMessage= message[1];这个showMessage就是你要的 或string txt="Placeholder#ErrorMessege#Placeholder";string[] sArray = txt.Split('#');foreach (string t in sArray){ Console.WriteLine(t);}Console.ReadLine(); string str = "Placeholder#ErrorMessege#Placeholder";int firstIndex = str.IndexOf("#");int secondIndex = str.IndexOf("#", firstIndex + 1);string ret = str.Substring(firstIndex + 1, secondIndex - firstIndex - 1); datetime.tofiletime()的用法 新人问个泛型问题 vs2005中调试asp.net时如何人把的浏览器指定为使用遨游? 打开word文档,并写入数据,顶帖有分... .net 如何创建及销毁com对象的? 请教一个编码问题,从java的语法,如何变成C#的语法? 如何用c#实现缩略图和图片的远程保存 如何动态的配置web.config 关于AzDGCrypt算法C#实现,高手搞起来 c#多功能计算器怎么制作 有关三层架构的问题 datagrid单元格里面放个table,怎么取table中的input控件?
string showMessage= message[1];
这个showMessage就是你要的
string[] sArray = txt.Split('#');
foreach (string t in sArray)
{
Console.WriteLine(t);
}
Console.ReadLine();
int firstIndex = str.IndexOf("#");
int secondIndex = str.IndexOf("#", firstIndex + 1);
string ret = str.Substring(firstIndex + 1, secondIndex - firstIndex - 1);