private static String parsePhoneNumberForMms(String address){
  StringBuilder builder=new StringBuilder();
  int len=address.length();
  for (int i=0; i < len; i++) {
    char c=address.charAt(i);
    if (c == '+' && builder.length() == 0) {
      builder.append(c);
      continue;
    }
    if (Character.isDigit(c)) {
      builder.append(c);
      continue;
    }
    if (numericSugarMap.get(c) == null) {
      return null;
    }
  }
  return builder.toString();
}

private static String parsePhoneNumberForMms ( String address ) { StringBuilder builder = new StringBuilder ( ) ; int len = address . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = address . charAt ( i ) ; if ( c == '+' && builder . length ( ) == 0 ) { builder . append ( c ) ; continue ; } if ( Character . isDigit ( c ) ) { builder . append ( c ) ; continue ; } if ( numericSugarMap . get ( c ) == null ) { return null ; } } return builder . toString ( ) ; }
given a phone number , return the string without syntactic sugar , meaning parens , spaces , slashes , dots , dashes , etc . if the input string contains non - numeric non - punctuation characters , return null .
