0

In VB6, I could say:

s = Replace(s, "Find", "Replace", vbTextCompare)

In VB.NET, there is only String.Replace(uFind, uReplace) which would mean binary compare, I guess.

Is there no .NET version that would provide the usual CultureInvariantIgnoreDayTimeAndHowEmptyMyStomachIs and similar search option?

enter image description here

tmighty
  • 10,734
  • 21
  • 104
  • 218
  • 4
    See the method [overloads](https://learn.microsoft.com/en-us/dotnet/api/system.string.replace?view=net-6.0#overloads)! – dr.null Jul 06 '22 at 04:26
  • 1
    I don't have them. I have added 2 screenshots. – tmighty Jul 06 '22 at 20:13
  • 1
    Right, not under NET Framework 4x. In this case, either use `System.Text.RegularExpressions.Regex.Replace` method to do so, or you still can use the vb6 `Replace` method. Add reference to **Microsoft.VisualBasic** (if not already) and import the `Microsoft.VisualBasic` namespace. – dr.null Jul 06 '22 at 20:39
  • 1
    See https://stackoverflow.com/questions/6275980/string-replace-ignoring-case – dr.null Jul 06 '22 at 20:47
  • Does this answer your question? [String.Replace ignoring case](https://stackoverflow.com/questions/6275980/string-replace-ignoring-case) – Andrew Morton Jul 07 '22 at 19:34

0 Answers0