string str = "yes....";
str = str.Replace( "yes" , "no")

解决方案 »

  1.   

    Replace就是了
    比如:
    string a="this is word :yes";
    a.Replace("yes","no");
      

  2.   

    sorry,的确是和LZ的意思反了哈!
    -----------------
     
     // 摘要:
            //     将此实例中的指定 System.String 的所有匹配项替换为其他指定的 System.String。
            //
            // 参数:
            //   oldValue:
            //     要替换的 System.String。
            //
            //   newValue:
            //     要替换 oldValue 的所有匹配项的 System.String。
            //
            // 返回结果:
            //     等效于此实例,但将 oldValue 的所有实例都替换为 newValue 的 System.String。
            public string Replace(string oldValue, string newValue);
      

  3.   

    //呵呵
    string str = "no....";
    str = str.Replace( "no" , "yes")
      

  4.   

    少了个分号
    string str = "no....";
    str = str.Replace( "no" , "yes");
      

  5.   

    str = str.Replace( "no","yes");
    嘿嘿  分杯羹可以不?
      

  6.   

    控制台程序,是否要用Console.Readline()之类的来读取输入值呢?
      

  7.   

    str = str.Replace("no", "yes");
      

  8.   

    str = str.Replace( "no" , "yes");
      

  9.   

    static void Main(){
                string input = Console.ReadLine();            
                string result;
                result = System.Text.RegularExpressions.Regex.Replace(input, "no", "yes");
                // OR
                // result = result.Replace("no", "yes");
                Console.Write(result);
                Console.ReadLine();
            }