比如,我想输出
abc{123}这个字符串,如果放在format里,它会认为是我想做格式化输出,
我试过
string.Format("abc\{123\}")了,也不行,有什么办法没

解决方案 »

  1.   

    string.Format的参数就是format的格式。你把abc{123}作为format干什么?
      

  2.   

    http://topic.csdn.net/t/20030716/15/2035581.html
      

  3.   

    Format的参数就是format的格式 不是楼主写的那个东东
      

  4.   

    在多2对{}就搞定了,转义\在这里是无法使用的。string s = string.Format("abc{{{0}}}", "123");
    Response.Write(s);
    //输出结果
    abc{123}
      

  5.   

    我就知道,每当简化出一个问题,问你们的时候,总是有人,头疼医脚的问,为什么要这么做……好吧string.format("abc{0}{123}",9999);
    我想得到"abc{9999}{123}"这个字符串,怎么办非得我写出来……
      

  6.   


    这样的一样道理啊string s = string.Format("abc{{{0}}}{{{1}}}", "9999","123");
    Response.Write(s);
    //输出
    abc{9999}{123} 
      

  7.   

    这样的也没问题啊string s = string.Format("abc{{{0}}}{{{1}}}", "9999","123");
     Response.Write(s);//输出abc{9999}{123}
      

  8.   

    你直接输出就好了 为什么还要用 format 格式化