how can I replace all string in string varaiable like
dim str = "I am testing and testing and testing"
After replace with "and"
ReplaceAll(str,"and","or")
How can I replace all with case insentive not case sensative?
how can I replace all string in string varaiable like
dim str = "I am testing and testing and testing"
After replace with "and"
ReplaceAll(str,"and","or")
How can I replace all with case insentive not case sensative?
Sounds like a case for regular expressions:
From 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")
Despite the use of Regular Expression, as suggested by Matt and RQDQ, you can use the VB sugar, like:
Replace(expression, find, replacement, start, count, compare)
From the documentation.