c# - string.ToLower 和 TextInfo.ToLower 之间的区别

标签 c# .net

两者有什么区别?我应该什么时候使用它们?

最佳答案

没有。

string.ToLower 在幕后调用 TextInfo.ToLower

来自 String.cs:

    // Creates a copy of this string in lower case. 
    public String ToLower() {
        return this.ToLower(CultureInfo.CurrentCulture); 
    }

    // Creates a copy of this string in lower case.  The culture is set by culture.
    public String ToLower(CultureInfo culture) { 
        if (culture==null) {
            throw new ArgumentNullException("culture"); 
        } 
        return culture.TextInfo.ToLower(this);
    } 

关于c# - string.ToLower 和 TextInfo.ToLower 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10785896/

相关文章:

javascript - 使用 C# 从 Chrome 中现有打开的选项卡中检索值

c# - 使用 FileShare.Delete 会导致 UnauthorizedAccessException 吗?

c# - .NET 双重除法无效强制转换异常

c# - 使用 StartsWith 将值与字符串数组进行比较

c# - Java 中可以通过引用传递参数吗?

c# - 如何设置程序在启动时启动

c# - 解析动态 JSON 字符串

c# - 任何基于 WPF 的 Markdown 渲染器?

c# - 如何从 IEnumerable 方法调用 IEnumerable 方法?

javascript - 如何使用Javascript访问EditItemTemplate中下拉列表的ID?