06 Feb 2006
public boolean isValidPhone(String sAreaCode, String sPrefix, String sSuffix)
{
return this.isValidPhonePart(sAreaCode,3) && this.isValidPhonePart(sSuffix,4);
}
public boolean isValidPhonePart(String sValue, int iLength)
{
for(int iCounter = 0; iCounter < sValue.length(); iCounter++)
{
switch(sValue.charAt(iCounter))
{
case '0':
case '1':
case '2':
break;
default:
return false;
}
}
return (sValue.length() == iLength);
}
{"display_name"=>"chris", "login"=>"chris", "email"=>"crmacd@gmail.com", "url"=>"http://www.crmacd.com"}