MCPcopy Create free account
hub / github.com/davidgiven/luje / convertHexToLowerCase

Method convertHexToLowerCase

lib/java/net/URI.java:994–1008  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

992 * converts the hex values following the '%' to lowercase
993 */
994 private String convertHexToLowerCase(String s) {
995 StringBuilder result = new StringBuilder(""); //$NON-NLS-1$
996 if (s.indexOf('%') == -1) {
997 return s;
998 }
999
1000 int index = 0, previndex = 0;
1001 while ((index = s.indexOf('%', previndex)) != -1) {
1002 result.append(s.substring(previndex, index + 1));
1003 result.append(s.substring(index + 1, index + 3).toLowerCase());
1004 index += 3;
1005 previndex = index;
1006 }
1007 return result.toString();
1008 }
1009
1010 /*
1011 * Takes two strings that may contain hex sequences like %F1 or %2b and

Callers 1

getHashStringMethod · 0.95

Calls 5

appendMethod · 0.95
toStringMethod · 0.95
indexOfMethod · 0.65
substringMethod · 0.45
toLowerCaseMethod · 0.45

Tested by

no test coverage detected