[Lazarus] Checking characters in a string

Richard Mace richard.mace at gmail.com
Wed Mar 12 16:23:48 CET 2014


OK. Perhaps I could just look for a string with a number in it?
Richard
On 12 Mar 2014 14:05, "silvioprog" <silvioprog at gmail.com> wrote:

> 2014-03-12 10:53 GMT-03:00 Richard Mace <richard.mace at gmail.com>:
>
>> Hi,
>> 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?
>>
>
> In a function, create three Boolean variables (eg. VContainsUpperCase,
> VContainsLowerCase, VContainsNumber), make a loop through the string and,
> the measure that finding the ocurrences, set the respective variable to
> true. Finally, the result will "Result := VContainsUpperCase and
> VContainsLowerCase and VContainsNumber".
>
> You can also do this with a set of enums. The function would return the
> set itself. If you are interested, I can explain how it would be with the
> set too.
>
> --
> Silvio Clécio
> My public projects - github.com/silvioprog
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140312/b9763b7b/attachment-0003.html>


More information about the Lazarus mailing list