Replace a string but ignore the case, I keep forgetting about this little handy function
Heres an example of usage
1 2 3 4 5 6 7 8 9 10 11 |
'Import the library you need to use Imports System.Text.RegularExpressions 'set up some vars here to play with Dim TheString As String = "fint THAT String I need to change" Dim ReplaceText As String = "the" Dim TheResultsString As String 'INSTEAD OF THIS TheResultsString = TheString.Replace("THAT", ReplaceText) 'DO THIS TheResultsString = Regex.Replace(TheString, "that", ReplaceText, RegexOptions.IgnoreCase) |
Good one