【发布时间】:2023-03-25 02:47:01
【问题描述】:
我想看看
public String Replace(String oldValue, String newValue);
mscorlib.dll (System.String) 中的方法有效。
我用 dotPeek 反编译了 mscorlib.dll,在方法内部有一个对 ReplaceInternal 方法的调用,但我找不到它
string s = ReplaceInternal(oldValue, newValue);
我什至在 GIT 的开源 .NET Core 上搜索过这种方法,但没有运气。
请解释一下这个方法在哪里,里面是什么?
【问题讨论】:
-
ReplaceInternalistextern,所以很可能它被实现为“非托管”的本机 C++ 代码。详情请见P/Invoke。 -
btw不需要反编译,可以看源码@referencesource.microsoft.com/#mscorlib/system/…
标签: c# .net string replace decompiler