2014-03-12 10:53 GMT-03:00 Richard Mace <[email protected]>: > 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 [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
