![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
как узнать что чар это цифра, буква, то и другое? [D5, NT4]
Аццкий © (2012-02-21 22:51:00)а
Ф1 (2012-02-22 00:07:00) [1]
> DVM © (22.02.12 00:02) [6]
а, ну да, это же Альфа...
DVM (2012-02-22 00:02:00) [2]
> Ф1 (22.02.12 00:00) [5]
> ну, нету.
Как же нету, вон они все.
Ф1 (2012-02-22 00:00:00) [3]
> DVM © (21.02.12 23:55) [4]
ну, нету.
кстати,
> IsCharAlphaNumeric
тоже трудно назвать штатной, апишная.
> была такая функция IsAlpha
>
> Но не в делфи.
в делфи можно IsCharAlpha, апишная
DVM (2012-02-21 23:55:00) [4]
> Ф1 (21.02.12 23:49) [3]
> Но не в делфи.
{*******************************************************}
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
{ }
{*******************************************************}
unit System.Character;
TCharacter = class sealed
private
class procedure Initialize; static;
class function IsLatin1(C: Char): Boolean; inline; static;
class function IsAscii(C: Char): Boolean; inline; static;
class function CheckLetter(uc: TUnicodeCategory): Boolean; inline; static;
class function CheckLetterOrDigit(uc: TUnicodeCategory): Boolean; inline; static;
class function CheckNumber(uc: TUnicodeCategory): Boolean; inline; static;
class function CheckPunctuation(uc: TUnicodeCategory): Boolean; inline; static;
class function CheckSymbol(uc: TUnicodeCategory): Boolean; inline; static;
class function CheckSeparator(uc: TUnicodeCategory): Boolean; inline; static;
public
constructor Create;
class function ConvertFromUtf32(C: UCS4Char): string; static;
class function ConvertToUtf32(const S: string; Index: Integer): UCS4Char; overload; inline; static;
class function ConvertToUtf32(const S: string; Index: Integer; out CharLength: Integer): UCS4Char; overload; static;
class function ConvertToUtf32(const HighSurrogate, LowSurrogate: Char): UCS4Char; overload; static;
class function GetNumericValue(C: Char): Double; overload; static;
class function GetNumericValue(const S: string; Index: Integer): Double; overload; static;
class function GetUnicodeCategory(C: Char): TUnicodeCategory; overload; static;
class function GetUnicodeCategory(const S: string; Index: Integer): TUnicodeCategory; overload; static;
class function IsControl(C: Char): Boolean; overload; static;
class function IsControl(const S: string; Index: Integer): Boolean; overload; static;
class function IsDigit(C: Char): Boolean; overload; static;
class function IsDigit(const S: string; Index: Integer): Boolean; overload; static;
class function IsHighSurrogate(C: Char): Boolean; overload; inline; static;
class function IsHighSurrogate(const S: string; Index: Integer): Boolean; overload; inline; static;
class function IsLetter(C: Char): Boolean; overload; static;
class function IsLetter(const S: string; Index: Integer): Boolean; overload; static;
class function IsLetterOrDigit(C: Char): Boolean; overload; static;
class function IsLetterOrDigit(const S: string; Index: Integer): Boolean; overload; static;
class function IsLower(C: Char): Boolean; overload; static;
class function IsLower(const S: string; Index: Integer): Boolean; overload; static;
class function IsLowSurrogate(C: Char): Boolean; overload; inline; static;
class function IsLowSurrogate(const S: string; Index: Integer): Boolean; overload; inline; static;
class function IsNumber(C: Char): Boolean; overload; static;
class function IsNumber(const S: string; Index: Integer): Boolean; overload; static;
class function IsPunctuation(C: Char): Boolean; overload; static;
class function IsPunctuation(const S: string; Index: Integer): Boolean; overload; static;
class function IsSeparator(C: Char): Boolean; overload; static;
class function IsSeparator(const S: string; Index: Integer): Boolean; overload; static;
class function IsSurrogate(Surrogate: Char): Boolean; overload; inline; static;
class function IsSurrogate(const S: string; Index: Integer): Boolean; overload; static;
class function IsSurrogatePair(const HighSurrogate, LowSurrogate: Char): Boolean; overload; inline; static;
class function IsSurrogatePair(const S: string; Index: Integer): Boolean; overload; static;
class function IsSymbol(C: Char): Boolean; overload; static;
class function IsSymbol(const S: string; Index: Integer): Boolean; overload; static;
class function IsUpper(C: Char): Boolean; overload; static;
class function IsUpper(const S: string; Index: Integer): Boolean; overload; static;
class function IsWhiteSpace(C: Char): Boolean; overload; static;
class function IsWhiteSpace(const S: string; Index: Integer): Boolean; overload; static;
class function ToLower(C: Char): Char; overload; static;
class function ToLower(const S: string): string; overload; static;
class function ToUpper(C: Char): Char; overload; static;
class function ToUpper(const S: string): string; overload; static;
end;
Ф1 (2012-02-21 23:49:00) [5]
> понятно что говорилось о принадлежности к множеству.
нихрена не понятно. говори нормально, падонкоффский стиль не есть стандарт.
> , помню была такая функция IsAlpha
в С, Java and other. Но не в делфи.
> или IsAbc
ложное воспоминание.
Аццкий (2012-02-21 23:34:00) [6]
> Это нонсенс.
понятно что говорилось о принадлежности к множеству.
нашел функцию IsCharAlphaNumeric, помню была такая функция IsAlpha или IsAbc, но не могу найти.
Сергей М. (2012-02-21 23:14:00) [7]
> то и другое
Это нонсенс. По кр.мере в "великом и могучем" символ есть ИЛИ буква ИЛИ цифра ИЛИ что-то еще. Но никак не И буква И цифра одновременно)
if YourChar in ['А..Я', 'а'..'я'] then
буква
else if YourChar in ['0'..'9'] then
цифра
else
ЧерТеЧтоИсбокуБантик