我怎么能替换字符串varaiable像所有字符串
dim str = "I am testing and testing and testing"
更换后“和”
ReplaceAll(str,"and","or")
我怎么能代替所有情况下insentive不区分sensative?
我怎么能替换字符串varaiable像所有字符串
dim str = "I am testing and testing and testing"
更换后“和”
ReplaceAll(str,"and","or")
我怎么能代替所有情况下insentive不区分sensative?
听起来像是正则表达式的情况下:
从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);
Dim str As String = "I am testing and testing and testing"
str = str.Replace("and", "or")
尽管使用正则表达式的,由马特和RQDQ的建议,你可以使用VB糖,如:
Replace(expression, find, replacement, start, count, compare)
从文档 。