List of utility methods to do String Chop
String[] | chop(String[] arr, int pos) chop String[] res = new String[arr.length - pos]; for (int i = 0; i < arr.length - pos; i++) { res[i] = arr[pos + i]; return res; |
void | chop(StringBuffer buffer, int chars) Lobs the last chars off the StringBuffer
int numberToChop = Math.min(buffer.length(), chars);
buffer.delete(buffer.length() - numberToChop, buffer.length());
|
String | chopAccelerator(final String title) chop Accelerator int startPos = title.indexOf("\\t"); if (startPos > 0) { return title.substring(0, startPos); return title; |
String | ChopAllLf(String this_string, String chomp_off) Chop All Lf if (!this_string.contains(chomp_off)) return this_string; return ChopLf(this_string, chomp_off, SeekRt(this_string, chomp_off.charAt(0)) + this_string.length() + 1); |
String | ChopAllRt(String this_string, String chomp_off) Chop All Rt if (!this_string.contains(chomp_off)) return this_string; return this_string.substring(0, this_string.length() - SeekLf(this_string, chomp_off.charAt(0))); |
String | chopBraces(String s) Removes '[' and ']' from beginning and end of a String, but only if both are present. if (s.startsWith(STRSQBRACKETSTART) && s.endsWith(STRSQBRACKETEND)) return s.substring(1, s.length() - 1); return s; |
String[] | chopCommentFromArgs(String[] args) chop Comment From Args if (args == null) { return null; int commentStart = -1; for (int i = 0; i < args.length; i++) { if (args[i] != null && args[i].startsWith("//")) { commentStart = i; break; ... |
String | chopExt(String orig) chop Ext int lastDot = orig.lastIndexOf('.'); return lastDot < 0 ? orig : orig.substring(0, lastDot); |
String | chopFirstComponent(String s) Returns the string s with the first component removed.
int dotIx = s.indexOf('.'); return dotIx < 0 ? s : s.substring(1 + dotIx); |
float | chopFractionalPart(float original, int no_of_digits ) Limitation: (original * 10^no_of_digits) has to fit in a signed integer (java integers are 32bit) int mult = __chopFractionalPart_lookup[no_of_digits]; return Math.round(original * mult) / (float) mult; |