Pacurar Stefan Pacurar Stefan - 1 year ago 133
C# Question

decompile .NET Replace method (v4.6.1)

I want to see how the

public String Replace(String oldValue, String newValue);

method that is inside mscorlib.dll (System.String) works.

I decompiled the mscorlib.dll with dotPeek and inside the method there is a call to ReplaceInternal method which I cannot find it

string s = ReplaceInternal(oldValue, newValue);

I have search for this method even on the open source .NET Core from GIT but no luck.

View my Decompiled code

Please explain where is this method and what is inside?

Answer Source

The extern C++ code is here.

Line 1578 has

FCIMPL3(Object*, COMString::ReplaceString, StringObject* thisRefUNSAFE, StringObject* oldValueUNSAFE, StringObject* newValueUNSAFE)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download