怎样从匹配的字符串 截取到 匹配的字符串
例如:
我想从
包含 也行就是说我想得到之间的字符串

解决方案 »

  1.   

    string str = "123234";
    string temp = str.Substring(str.Indexof(""));
    temp就是如果你想去掉
    也用同样的办法
    主要就是用substring和indexof
      

  2.   

    if(string.startwith("[img]")&&string.endwith("[\img]"))
    string=string.replace("[img]","").replace("[\img]","");
      

  3.   

    你这个明显是一个类似Xml的带格式文本,为什么不找一个解析器呢?
      

  4.   

    using System.Text.RegularExpressions;
    string input="";
    Regex reg=new Regex(@"(?<=[img].*?[?=/img]");
    string output=reg.Match(input).Value;
      

  5.   

    上面写错了:using System.Text.RegularExpressions;
    string input="";
    Regex reg=new Regex(@"(?<=)");
    string output=reg.Match(input).Value;