I gonna get MethodInfo of String.TrimStart()
The following code returns null.
typeof(string).GetMethod("TrimStart", new Type[ ] {});
and the following code returns {System.String TrimStart(Char[])}
typeof(string).GetMethod("TrimStart", BindingFlags.Public | BindingFlags.Instance);
I wanna get {System.String TrimStart()} exactly ?
There is no
String.TrimStart()method.There is only
String.TrimStart(params Char[] source)overload. You can invoke it without any paramteres thanks toparamskeyword.In other words:
String.TrimStart()"invokes"String.TrimStart(new char[0]).More: params keyword on msdn