public static void validateSimple(String s, String legal)throws URISyntaxException {for (int i = 0; i < s.length(); i++) {char ch = s.charAt(i);if (!((ch >= 'a' && ch <= 'z')|| (ch >= 'A' && ch <= 'Z')|| (ch >= '0' && ch <= '9')|| legal.indexOf(ch) > -1)) {throw new URISyntaxException(s, "Illegal character", i);}}}

public static void validateSimple(string s, string legal){{for (int i = 0; i < s.Length; i++){char ch = s[i];if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <='9') || legal.IndexOf(ch) > -1)){throw new java.net.URISyntaxException(s, "Illegal character", i);}}}}
