[Lazarus] Checking characters in a string

Michael Schnell mschnell at lumino.de
Wed Mar 12 15:11:41 CET 2014


On 03/12/2014 02:53 PM, Richard Mace wrote:
> I am trying to check to make sure the a string contains at least 1 
> uppercase character, 1 lowercase character and 1 number.
> Any ideas as of the best way of coding this?
When using Unicode (under the hood) this is really difficult, as (AFAIK) 
there is no decent definition what "Uppercase" is.

At best you do a list of all the characters you want to seek for (i.e. a 
string for each "character",  as in Unicode there is no such thging as a 
character) and do a "pos()" which each of them.

But even then you can't be sure as in Unicode there are multiple ways to 
code certain characters and you will only find the coding style you 
defined.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140312/51c6cba5/attachment-0003.html>


More information about the Lazarus mailing list