Looking here , you will notice the following:
// This method contains the same functionality as StringBuilder Replace. // The only difference is that // a new String has to be allocated since Strings are immutable [System.Security.SecuritySafeCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern String ReplaceInternal(String oldValue, String newValue);
The extern keyword means that this method is implemented externally in another dll.
Moreover, it can even be written in an uncontrolled dll (possibly in C ++), which is used by this module. Thus, you cannot decompile this code or see it, as usual, with managed code.
Update
After a short search, I found the appropriate code in the coreclr project:
https://github.com/dotnet/coreclr/blob/master/src/classlibnative/bcltype/stringnative.cpp
source share