Fix String.Replace implementation (dotnet/coreclr#11039)
* Fix String.Replace implementation
String.Replace was callin ga low level CompareInfo method IndexOfCore which cannot be called in some conditions like when using ordinal ignore case option or when running in invariant mode.
The fix is to call a higher level method in CompareInfo which can handle such cases becfore calling the lower level method
* fix typo
Commit migrated from https://github.com/dotnet/coreclr/commit/
cb371832f635664f74f99b9e0fa405eef2148a2f