Skip to content

TCharacter

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Character operation

Declaration

Source position: character.pas line 78

Type
  TCharacter = class
  private
    class function TestCategory(const AString: UnicodeString; 
                               AIndex: Integer; ACategory: TUnicodeCategory)
                                : Boolean;  Overload;  Static;
    class function TestCategory(const AString: UnicodeString; 
                               AIndex: Integer; 
                               ACategory: TUnicodeCategorySet) : Boolean
                               ;  Overload;  Static;
  public
    constructor Create;
    class function ConvertFromUtf32(AChar: UCS4Char) : UnicodeString
                                   ;  Static;
    class function ConvertToUtf32(const AString: UnicodeString; 
                                 AIndex: Integer) : UCS4Char;  Overload
                                 ;  Static;
    class function ConvertToUtf32(const AString: UnicodeString; 
                                 AIndex: Integer; out ACharLength: Integer)
                                  : UCS4Char;  Overload;  Static;
    class function ConvertToUtf32(const AHighSurrogate: UnicodeChar; 
                                 const ALowSurrogate: UnicodeChar)
                                  : UCS4Char;  Overload;  Static;
    class function GetNumericValue(AChar: UnicodeChar) : Double;  Overload
                                  ;  Static;
    class function GetNumericValue(const AString: UnicodeString; 
                                  AIndex: Integer) : Double;  Overload
                                  ;  Static;
    class function GetUnicodeCategory(AChar: UnicodeChar) : TUnicodeCategory
                                     ;  Overload;  Static;
    class function GetUnicodeCategory(const AString: UnicodeString; 
                                     AIndex: Integer) : TUnicodeCategory
                                     ;  Overload;  Static;
    class function IsControl(AChar: UnicodeChar) : Boolean;  Overload
                            ;  Static;
    class function IsControl(const AString: UnicodeString; AIndex: Integer)
                             : Boolean;  Overload;  Static;
    class function IsDigit(AChar: UnicodeChar) : Boolean;  Overload;  Static;
    class function IsDigit(const AString: UnicodeString; AIndex: Integer)
                           : Boolean;  Overload;  Static;
    class function IsSurrogate(AChar: UnicodeChar) : Boolean;  Overload
                              ;  Static;
    class function IsSurrogate(const AString: UnicodeString; 
                              AIndex: Integer) : Boolean;  Overload;  Static;
    class function IsHighSurrogate(AChar: UnicodeChar) : Boolean;  Overload
                                  ;  Static;
    class function IsHighSurrogate(const AString: UnicodeString; 
                                  AIndex: Integer) : Boolean;  Overload
                                  ;  Static;
    class function IsLowSurrogate(AChar: UnicodeChar) : Boolean;  Overload
                                 ;  Static;
    class function IsLowSurrogate(const AString: UnicodeString; 
                                 AIndex: Integer) : Boolean;  Overload
                                 ;  Static;
    class function IsSurrogatePair(const AHighSurrogate: UnicodeChar; 
                                  const ALowSurrogate: UnicodeChar)
                                   : Boolean;  Overload;  Static;
    class function IsSurrogatePair(const AString: UnicodeString; 
                                  AIndex: Integer) : Boolean;  Overload
                                  ;  Static;
    class function IsLetter(AChar: UnicodeChar) : Boolean;  Overload
                           ;  Static;
    class function IsLetter(const AString: UnicodeString; AIndex: Integer)
                            : Boolean;  Overload;  Static;
    class function IsLetterOrDigit(AChar: UnicodeChar) : Boolean;  Overload
                                  ;  Static;
    class function IsLetterOrDigit(const AString: UnicodeString; 
                                  AIndex: Integer) : Boolean;  Overload
                                  ;  Static;
    class function IsLower(AChar: UnicodeChar) : Boolean;  Overload;  Static;
    class function IsLower(const AString: UnicodeString; AIndex: Integer)
                           : Boolean;  Overload;  Static;
    class function IsNumber(AChar: UnicodeChar) : Boolean;  Overload
                           ;  Static;
    class function IsNumber(const AString: UnicodeString; AIndex: Integer)
                            : Boolean;  Overload;  Static;
    class function IsPunctuation(AChar: UnicodeChar) : Boolean;  Overload
                                ;  Static;
    class function IsPunctuation(const AString: UnicodeString; 
                                AIndex: Integer) : Boolean;  Overload
                                ;  Static;
    class function IsSeparator(AChar: UnicodeChar) : Boolean;  Overload
                              ;  Static;
    class function IsSeparator(const AString: UnicodeString; 
                              AIndex: Integer) : Boolean;  Overload;  Static;
    class function IsSymbol(AChar: UnicodeChar) : Boolean;  Overload
                           ;  Static;
    class function IsSymbol(const AString: UnicodeString; AIndex: Integer)
                            : Boolean;  Overload;  Static;
    class function IsUpper(AChar: UnicodeChar) : Boolean;  Overload;  Static;
    class function IsUpper(const AString: UnicodeString; AIndex: Integer)
                           : Boolean;  Overload;  Static;
    class function IsWhiteSpace(AChar: UnicodeChar) : Boolean;  Overload
                               ;  Static;
    class function IsWhiteSpace(const AString: UnicodeString; 
                               AIndex: Integer) : Boolean;  Overload
                               ;  Static;
    class function ToLower(AChar: UnicodeChar) : UnicodeChar;  Overload
                          ;  Static;
    class function ToLower(const AString: UnicodeString) : UnicodeString
                          ;  Overload;  Static;
    class function ToLower(const AString: UnicodeString; 
                          const AOptions: TCharacterOptions) : UnicodeString
                          ;  Overload;  Static;
    class function ToUpper(AChar: UnicodeChar) : UnicodeChar;  Overload
                          ;  Static;
    class function ToUpper(const AString: UnicodeString) : UnicodeString
                          ;  Overload;  Static;
    class function ToUpper(const AString: UnicodeString; 
                          const AOptions: TCharacterOptions) : UnicodeString
                          ;  Overload;  Static;
  end
  ;

Description

TCharacter is provided for Delphi compatibility. All it's class functions and methods are also available as regular functions.

Members

Member Type Visibility Description
ConvertFromUtf32 Method public Convert a UTF32 character to UnicodeString
ConvertToUtf32 Method public Convert a UTF16 character to a UTF32 character
Create Method public Constructor (do not call)
GetNumericValue Method public Get the numeric value of the character
GetUnicodeCategory Method public Get the Unicode category of a character
IsControl Method public Check whether a Unicode character is a Unicode control character
IsDigit Method public Check whether a Unicode character is a digit
IsHighSurrogate Method public Check whether a Unicode character is a surrogate in the high range
IsLetter Method public Check if a Unicode character is a letter.
IsLetterOrDigit Method public Check if a Unicode character is a letter or digit
IsLower Method public Check if a Unicode character is a lowercase letter
IsLowSurrogate Method public Check whether a Unicode character is a surrogate in the low range
IsNumber Method public Check if a Unicode character is a number
IsPunctuation Method public Check if a Unicode character is a punctuation character
IsSeparator Method public Check if a Unicode character is a separator character
IsSurrogate Method public Check whether a Unicode character is a surrogate
IsSurrogatePair Method public Check if a pair of characters is a set of high/low surrogate characters
IsSymbol Method public Check if a Unicode character is a symbol character
IsUpper Method public Check whether a Unicode character is an uppercase letter
IsWhiteSpace Method public Check whether a Unicode character is a whitespace character
TestCategory Method private
ToLower Method public Convert a character or string to lowercase
ToUpper Method public Convert a character or string to uppercase

Inheritance

Class Description
TCharacter Character operation