Method to count number of characters in a string?
hi.
i'm trying to write some script that will count the number of characters in a string passed into a constructor and then compare it against another value to check whether the string passed in is valid.
something like this
public class Stringcheck
{
public static int maxStringLength;
public static double minSize;
public static boolean testStringLength(String x)
// Insert method for counting number of chars in String x and name as 'intnumberOfChars
if(number of Chars <= maxStringLength )
{
return true;
}
else
{
return false;
}
}
can someone help me with writing this script.
Thanks
Richard.

