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
public class TextInfo : ICloneable, System.Runtime.Serialization.IDeserializationCallback
[System.Serializable]
public 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 屬性來取得特定 CultureInfo 物件的 TextInfo 物件。The application should use the CultureInfo.TextInfo property to obtain the TextInfo object for a particular CultureInfo object. 如果安全性決策取決於字串比較或大小寫變更作業,則應用程式應該使用 CultureInfo.InvariantCulture 屬性所傳回之物件的 CultureInfo.TextInfo 屬性,以確保不論作業系統文化特性設定為何,作業的行為都是一致的。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.

[覆寫]Overrides

使用者可以使用 [控制台] 的 [地區及語言選項] 部分,覆寫與 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.UseUserOverride 屬性設定為 true,則 CultureInfo.DateTimeFormatCultureInfo.NumberFormatCultureInfo.TextInfo 屬性所傳回之物件的屬性值也會從使用者設定中抓取。If 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) 字碼頁 (Code Page)。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 的淺層複本 (Shallow Copy)。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)

還原序列化 (Deserialization) 完成後,引發還原序列化事件。Raises the deserialization event when deserialization is complete.

適用於

另請參閱