替换 VB.net 中的所有函数 [英] Replace All Function in VB.net
本文介绍了替换 VB.net 中的所有函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何替换字符串变量中的所有字符串
how can I replace all string in string varaiable like
dim str = "I am testing and testing and testing"
用和"替换后
ReplaceAll(str,"and","or")
如何用不区分大小写而不区分大小写的方式替换所有内容?
How can I replace all with case insentive not case sensative?
推荐答案
听起来像是正则表达式的案例:
Sounds like a case for regular expressions:
来自 http://weblogs.asp.net/jgalloway/archive/2004/02/11/71188.aspx
using System.Text.RegularExpressions;
string myString = "find Me and replace ME";
string strReplace = "me";
myString = Regex.Replace(myString, "me", strReplace, RegexOptions.IgnoreCase);
这篇关于替换 VB.net 中的所有函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文