Determine if a URI string has a scheme component. @param uri The URI to test @return true if a scheme is present, otherwise {code @false}
(CharSequence uri)
| 90 | * @return {@code true} if a scheme is present, otherwise {code @false} |
| 91 | */ |
| 92 | public static boolean hasScheme(CharSequence uri) { |
| 93 | int len = uri.length(); |
| 94 | for (int i = 0; i < len; i++) { |
| 95 | char c = uri.charAt(i); |
| 96 | if (c == ':') { |
| 97 | return i > 0; |
| 98 | } else if (!isSchemeChar(c)) { |
| 99 | return false; |
| 100 | } |
| 101 | } |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | |
| 106 | /** |
no test coverage detected