MCPcopy Create free account
hub / github.com/curtcox/JLHTTP / trimRight

Method trimRight

src/main/java/net/freeutils/httpserver/HTTPServer.java:2586–2591  ·  view source on GitHub ↗

Returns the given string with all occurrences of the given character removed from its right side. @param s the string to trim @param c the character to remove @return the trimmed string

(String s, char c)

Source from the content-addressed store, hash-verified

2584 * @return the trimmed string
2585 */
2586 public static String trimRight(String s, char c) {
2587 int len = s.length() - 1;
2588 int end;
2589 for (end = len; end >= 0 && s.charAt(end) == c; end--);
2590 return end == len ? s : s.substring(0, end + 1);
2591 }
2592
2593 /**
2594 * Returns the given string with all occurrences of the given character

Callers 4

getParentPathMethod · 0.95
getContextMethod · 0.80
addContextMethod · 0.80
getParamsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected