List of utility methods to do String Strip
String | stripTags(String html) Remove all text contained within "< >" tags. StringBuilder stripped = new StringBuilder(); while (html.length() > 0) { int idx = html.indexOf("<"); if (idx < 0) { stripped.append(html.trim()); break; String text = html.substring(0, idx); ... |
String | stripTags(String in) This method takes a string and strips out all tags except tags while still leaving the tag body intact. if (in == null) { return null; char ch; int i = 0; int last = 0; char[] input = in.toCharArray(); int len = input.length; ... |
String | stripTrailingChar(String input, char c) Removes a single character from the end of a string if it matches. if (input == null) return null; if (input.isEmpty()) return input; char[] charArray = input.toCharArray(); if (charArray[charArray.length - 1] == c) { return new String(Arrays.copyOf(charArray, charArray.length - 1)); } else { ... |
String | stripUnsupportedChars(String str) strip Unsupported Chars if (isEmpty(str)) { return str; return str.replaceAll(":", ""); |