Hab*_*bib 11

它什么都不做,返回原始字符串.

请参阅:Convert.ToString方法(String)

返回指定的字符串实例; 没有执行实际转换.

这就是它的实现方式

public static String ToString(String value) {
    Contract.Ensures(Contract.Result<string>() == value);  // We were always skipping the null check here.
    return value;
}
Run Code Online (Sandbox Code Playgroud)

只是为了添加一个东西,System.Convert有方法将每个类型转换为自身,如Convert.ToInt32 Method(Int32),并且在所有情况下这些方法都不执行任何操作,返回实际值.

  • 用于发布实现加一个:) (3认同)