/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

anonymous

+4

// you really did it by hand?
public static String buildUrlEncode(String cityName) {
	if(cityName != null) {
		String encodedString = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((cityName.replace('.', '-'))
				  .replace('ù', 'u')).replace('ú', 'u')).replace('û', 'u')).replace('ü', 'u')).replace('ý', 'y')).replace('ë', 'e')).replace('à', 'a'))
				  .replace('á', 'a')).replace('â', 'a')).replace('ã', 'a')).replace('ä', 'a')).replace('å', 'a')).replace('æ', 'a')).replace('ç', 'c'))
				  .replace('è', 'e')).replace('é', 'e')).replace('ê', 'e')).replace('ë', 'e')).replace('ì', 'i')).replace('í', 'i')).replace('î', 'i'))
				  .replace('ï', 'i')).replace('ð', 'o')).replace('ñ', 'n')).replace('ò', 'o')).replace('ó', 'o')).replace('ô', 'o')).replace('õ', 'o'))
				  .replace('ö', 'o')).replace('ø', 'o')).replace(' ', '-')).replace('/', '-')).replace('\'', '-')).replace(":", "")).replace("~", ""))
				  .replace("!", "")).replace("@", "")).replace("#", "")).replace("$", "")).replace("%", "")).replace("*", "")).replace("(", ""))
				  .replace(")", "")).replace("_", "")).replace("+", "")).replace("{", "")).replace("}", "")).replace("[", "")).replace("]", ""))
				  .replace(";", "")).replace("'", "")).replace(":", "")).replace("\"", "")).replace("<", "")).replace(">", "")).replace("?", ""))
				  .replace(",-", "-")).replace("----", "-")).replace("---", "-")).replace("--", "-"));
		return encodedString;
	}
	return "";
}
 

Browse all snippets