how to constrain a string to 30 chars?
constrain a string to 30 chars java
Collapse
X
-
An easy, but not quite elegant solution would be to use a while loop - while the contents are over 30, get the string, get the length of the string, test while loop again, print out a message if you want..Originally posted by oll3ior sth like but again i get Constraint can not be resolved to a type error
public static Constraint FIRST_NAME = new MaxLengthConstr aint(30);
JavaDoc for String classComment
Comment