System.Text.RegularExpressions.Regex.Replace Methodpublic static string Replace(
   string input,
   string pattern,
   string replacement
);
string s = System.Text.RegularExpressions.Regex.Replace("abab","a","x");

解决方案 »

  1.   

    感谢您使用微软产品!不知您说的是不是VBScript中的Replace函数。在.NET中,String 类提供的不少字符串编辑函数,其中就有Replace函数,不过功能上比较简单。然而,您可以通过一系列函数的组合来实现对字符串的各种操作。-微软全球技术中心 VC技术支持本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
    为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。