Char.ToLower Method

Definition

将 Unicode 字符的值转换为它的小写等效项。Converts the value of a Unicode character to its lowercase equivalent.

Overloads

ToLower(Char, CultureInfo)

使用指定的区域性特定格式设置信息将指定 Unicode 字符的值转换为它的小写等效项。Converts the value of a specified Unicode character to its lowercase equivalent using specified culture-specific formatting information.

ToLower(Char)

将 Unicode 字符的值转换为它的小写等效项。Converts the value of a Unicode character to its lowercase equivalent.

ToLower(Char, CultureInfo)

使用指定的区域性特定格式设置信息将指定 Unicode 字符的值转换为它的小写等效项。Converts the value of a specified Unicode character to its lowercase equivalent using specified culture-specific formatting information.

public:
 static char ToLower(char c, System::Globalization::CultureInfo ^ culture);
public static char ToLower (char c, System.Globalization.CultureInfo culture);
static member ToLower : char * System.Globalization.CultureInfo -> char
Public Shared Function ToLower (c As Char, culture As CultureInfo) As Char

Parameters

c
Char

要转换的 Unicode 字符。The Unicode character to convert.

culture
CultureInfo

一个对象,用于提供区域性特定的大小写规则。An object that supplies culture-specific casing rules.

Returns

Char

c 的小写等效项(根据 culture 进行修改),或者,如果 c 已经是小写字母或不是字母,则为 c 的未更改值。The lowercase equivalent of c, modified according to culture, or the unchanged value of c, if c is already lowercase or not alphabetic.

Exceptions

culturenullculture is null.

Examples

下面的代码示例演示 ToLowerThe following code example demonstrates ToLower.

using namespace System;
using namespace System::Globalization;

// for CultureInfo
void main()
{
   Console::WriteLine( Char::ToLower( 'A' ) ); // Output: "a"
}

using System;
using System.Globalization;

public class ToLowerSample {
    public static void Main() {
        Console.WriteLine(Char.ToLower('A'));				// Output: "a"
    }
}
Module ToLowerSample

    Sub Main()
        Console.WriteLine(Char.ToLower("A"c))               ' Output: "a"
    End Sub

End Module

Remarks

使用 String.ToLower 将字符串转换为小写。Use String.ToLower to convert a string to lowercase.

See also

ToLower(Char)

将 Unicode 字符的值转换为它的小写等效项。Converts the value of a Unicode character to its lowercase equivalent.

public:
 static char ToLower(char c);
public static char ToLower (char c);
static member ToLower : char -> char
Public Shared Function ToLower (c As Char) As Char

Parameters

c
Char

要转换的 Unicode 字符。The Unicode character to convert.

Returns

Char

c 的小写等效项,或者,如果 c 已经是小写字母或不是字母,则为 c 的未更改值。The lowercase equivalent of c, or the unchanged value of c, if c is already lowercase or not alphabetic.

Examples

下面的示例演示 ToLowerThe following example demonstrates ToLower.

using namespace System;
using namespace System::Globalization;

// for CultureInfo
void main()
{
   Console::WriteLine( Char::ToLower( 'A' ) ); // Output: "a"
}

using System;
using System.Globalization;

public class ToLowerSample {
    public static void Main() {
        Console.WriteLine(Char.ToLower('A'));				// Output: "a"
    }
}
Module ToLowerSample

    Sub Main()
        Console.WriteLine(Char.ToLower("A"c))               ' Output: "a"
    End Sub

End Module

Remarks

大小写规则是从当前区域性获取的。Casing rules are obtained from the current culture.

使用 String.ToLower 将字符串转换为小写。Use String.ToLower to convert a string to lowercase.

Notes to Callers

使用字符串的最佳做法中所述,我们建议避免调用替换默认值的字符大小写方法和字符串大小写方法。As explained in Best Practices for Using Strings, we recommend that you avoid calling character-casing and string-casing methods that substitute default values. 相反,应调用需要显式指定参数的方法。Instead, you should call methods that require parameters to be explicitly specified. 若要使用当前区域性的大小写约定将字符转换为小写,请使用其 culture 参数的值 CurrentCulture 调用 ToLower(Char, CultureInfo) 方法重载。To convert a character to lowercase by using the casing conventions of the current culture, call the ToLower(Char, CultureInfo) method overload with a value of CurrentCulture for its culture parameter.

See also

Applies to