protected static String removeExtraDots(String host){
  StringBuilder stringBuilder=new StringBuilder();
  InputTextReader reader=new InputTextReader(host);
  while (!reader.eof()) {
    char curr=reader.read();
    stringBuilder.append(curr);
    if (curr == '.') {
      char possibleDot=curr;
      while (possibleDot == '.' && !reader.eof()) {
        possibleDot=reader.read();
      }
      if (possibleDot != '.') {
        stringBuilder.append(possibleDot);
      }
    }
  }
  if (stringBuilder.length() > 0 && stringBuilder.charAt(stringBuilder.length() - 1) == '.') {
    stringBuilder.deleteCharAt(stringBuilder.length() - 1);
  }
  if (stringBuilder.length() > 0 && stringBuilder.charAt(0) == '.') {
    stringBuilder.deleteCharAt(0);
  }
  return stringBuilder.toString();
}

protected static String removeExtraDots ( String host ) { StringBuilder stringBuilder = new StringBuilder ( ) ; InputTextReader reader = new InputTextReader ( host ) ; while ( ! reader . eof ( ) ) { char curr = reader . read ( ) ; stringBuilder . append ( curr ) ; if ( curr == '.' ) { char possibleDot = curr ; while ( possibleDot == '.' && ! reader . eof ( ) ) { possibleDot = reader . read ( ) ; } if ( possibleDot != '.' ) { stringBuilder . append ( possibleDot ) ; } } } if ( stringBuilder . length ( ) > 0 && stringBuilder . charAt ( stringBuilder . length ( ) - 1 ) == '.' ) { stringBuilder . deleteCharAt ( stringBuilder . length ( ) - 1 ) ; } if ( stringBuilder . length ( ) > 0 && stringBuilder . charAt ( 0 ) == '.' ) { stringBuilder . deleteCharAt ( 0 ) ; } return stringBuilder . toString ( ) ; }
removes all leading and trailing dots ; replaces consecutive dots with a single dot ex : " . lalal . . . . . com . " - > " lalal . com "
