现有字符test,如何变成"test"?
  string tmp = "test";
  return tmp .Replace(test,""+tmp+"");  我这样写,结果返回的还是test.请问大家怎么转?

解决方案 »

  1.   

    string tmp = "test";
      return tmp .Replace(tmp,""+tmp+"");
      

  2.   

    string tmp = "test";
      return tmp .Replace(tmp,"\"tmp\"");
      

  3.   

    string tmp = "test";
      return tmp .Replace(tmp,"\""+tmp+"\"");
      

  4.   

    anheizhizi(目标:★★★★★) ( ) 信誉:100  2006-08-10 17:20:00  得分: 0  
     
     
       string tmp = "test";
      return tmp .Replace(tmp,"\"tmp\"");  
     
      

  5.   

    呵呵,好累好累 是对的。
    return tmp .Replace(tmp,"\""+tmp+"\"");引号中如果有 " 应该用 转义字符