TextInfo 类

定义

定义特定于书写体系的文本属性和行为(如大小写)。Defines text properties and behaviors, such as casing, that are specific to a writing system.

public ref class TextInfo : ICloneable, System::Runtime::Serialization::IDeserializationCallback
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class TextInfo : ICloneable, System.Runtime.Serialization.IDeserializationCallback
type TextInfo = class
    interface ICloneable
    interface IDeserializationCallback
Public Class TextInfo
Implements ICloneable, IDeserializationCallback
继承
TextInfo
属性
实现

注解

书写系统是以文本形式表示语言所需的脚本和正交规则的集合。A writing system is the collection of scripts and orthographic rules required to represent a language as text. TextInfo类表示书写系统。The TextInfo class represents a writing system.

应用程序应使用CultureInfo.TextInfo属性来TextInfo获取特定CultureInfo对象的对象。The application should use the CultureInfo.TextInfo property to obtain the TextInfo object for a particular CultureInfo object. 如果安全决策取决于字符串比较或大小写更改操作,则应用程序应使用CultureInfo.TextInfo CultureInfo.InvariantCulture属性返回的对象的属性,以确保操作的行为保持一致,而不考虑操作系统区域性设置。If a security decision depends on a string comparison or a case-change operation, the application should use the CultureInfo.TextInfo property of the object returned by the CultureInfo.InvariantCulture property to ensure that the behavior of the operation is consistent regardless of the operating system culture settings.

OverridesOverrides

用户可以使用 "控制面板" 的 "区域和语言选项" 部分来替代与 Windows 的当前区域性相关联的值。The user might use the regional and language options portion of Control Panel to override the values associated with the current culture of Windows. 例如,用户可以选择以不同的格式显示日期,或使用区域性默认值以外的其他货币。For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. CultureInfo.DateTimeFormat CultureInfo.TextInfo CultureInfo.NumberFormat如果将true属性设置为,则还会从用户设置中检索、和属性返回的对象的属性值。 CultureInfo.UseUserOverrideIf the CultureInfo.UseUserOverride property is set to true, the property values of the objects returned by the CultureInfo.DateTimeFormat, CultureInfo.NumberFormat, and CultureInfo.TextInfo properties are also retrieved from the user settings. 如果用户设置与关联CultureInfo的区域性不兼容(例如,如果所选的日历不OptionalCalendars是),则方法的结果和属性的值是不确定的。If the user settings are incompatible with the culture associated with the CultureInfo, for example, if the selected calendar is not one of the OptionalCalendars, the results of the methods and the values of the properties are undefined.

属性

ANSICodePage

获取当前 TextInfo 所表示书写体系使用的“美国国家标准协会”(ANSI) 代码页。Gets the American National Standards Institute (ANSI) code page used by the writing system represented by the current TextInfo.

CultureName

获取与当前 TextInfo 对象关联的区域性的名称。Gets the name of the culture associated with the current TextInfo object.

EBCDICCodePage

获取当前 TextInfo 所表示书写体系使用的“扩充的二进制编码的十进制交换码”(EBCDIC) 代码页。Gets the Extended Binary Coded Decimal Interchange Code (EBCDIC) code page used by the writing system represented by the current TextInfo.

IsReadOnly

获取一个值,该值指示当前 TextInfo 对象是否为只读。Gets a value indicating whether the current TextInfo object is read-only.

IsRightToLeft

获取一个值,该值指示当前 TextInfo 对象是否表示一个文本书写方向为从右到左的书写体系。Gets a value indicating whether the current TextInfo object represents a writing system where text flows from right to left.

LCID

获取与当前 TextInfo 对象关联的区域性的区域性标识符。Gets the culture identifier for the culture associated with the current TextInfo object.

ListSeparator

获取或设置在列表中分隔项的字符串。Gets or sets the string that separates items in a list.

MacCodePage

获取当前 TextInfo 所表示书写体系使用的 Macintosh 代码页。Gets the Macintosh code page used by the writing system represented by the current TextInfo.

OEMCodePage

获取当前 TextInfo 所表示书写体系使用的“原始设备制造商”(OEM) 代码页。Gets the original equipment manufacturer (OEM) code page used by the writing system represented by the current TextInfo.

方法

Clone()

创建表示当前 TextInfo 对象副本的新对象。Creates a new object that is a copy of the current TextInfo object.

Equals(Object)

确定指定的对象是否与当前 TextInfo 对象表示同一书写体系。Determines whether the specified object represents the same writing system as the current TextInfo object.

GetHashCode()

用作当前 TextInfo 的哈希函数,适合用在哈希算法和数据结构(如哈希表)中。Serves as a hash function for the current TextInfo, suitable for hashing algorithms and data structures, such as a hash table.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ReadOnly(TextInfo)

返回指定的 TextInfo 对象的只读版本。Returns a read-only version of the specified TextInfo object.

ToLower(Char)

将指定的字符转换为小写。Converts the specified character to lowercase.

ToLower(String)

将指定的字符串转换为小写。Converts the specified string to lowercase.

ToString()

返回表示当前 TextInfo 的字符串。Returns a string that represents the current TextInfo.

ToTitleCase(String)

将指定字符串转换为词首字母大写(不包含视为首字母缩写的全部大写词)。Converts the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).

ToUpper(Char)

将指定的字符转换为大写。Converts the specified character to uppercase.

ToUpper(String)

将指定的字符串转换为大写。Converts the specified string to uppercase.

显式界面实现

IDeserializationCallback.OnDeserialization(Object)

反序列化完成时引发反序列化事件。Raises the deserialization event when deserialization is complete.

适用于

另请参阅