Are there pre-defined charsets in Delphi, to check if a character is a letter?
In Cocoa I use something like
if ([[NSCharacterSet whitespaceCharacterSet] characterIsMember:character])
I know I can do in Delphi
if c in ['A'..'Z'] then
but will this cover foreign accentuated characters like Á, À, Ú, É, ....?
What would be the most efficient way to check this in Delphi. I need to check if a string is fully composed with letters.
On Rad Studio XE4 I am told that TCharacter
is deprecated and to use System.Character.TCharHelper
instead. It is a record helper that extends type Char
with functions in method syntax. This means that I now add System.Character
to my uses list and can then call e.g. C.IsLetterOrDigit
where C
is of type Char
.
Try using the Character.TCharacter.IsLetter
or Character.IsLetter
functions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With