List of utility methods to do String Length Get
int | lengthExpandedTabs(String string, int toIdx, int tabWidth) Returns the length of a String prefix with tabs expanded. int len = 0; for (int idx = 0; idx < toIdx; idx++) { if (string.charAt(idx) == '\t') { len = (len / tabWidth + 1) * tabWidth; } else { len++; return len; |
String | lengthExpression(final String operand, final long length) Build expression to check the 'length' restriction, depending on the data type of the member variable. return String.format("%s.length() != %d", operand, length); |
String | lengthField(String propertyName) Creates the name of the Lucene document field which will store the length of a property. return LENGTH_PREFIX + propertyName;
|
String | lengthFormat(String str, int maxLength) length Format return str.length() > maxLength ? str.substring(0, maxLength) + "..." : str; |
int | lengthIfAllAlpha(String str) length If All Alpha int len = (str == null) ? 0 : str.length(); for (int i = 0; i < len; ++i) { char c1 = str.charAt(i); if (!((c1 >= 'A' && c1 <= 'Z') || (c1 >= 'a' && c1 <= 'z'))) { return 0; return len; ... |
int | lengthIntegers(String str) Length string int length = 0; if (str != null && !str.equals("null") && !str.equalsIgnoreCase("")) { String[] strArray = str.split(","); length = strArray.length; return length; |
int | lengthMinusColors(String thisStr) length Minus Colors int size = 0; for (int i = 0; i < thisStr.length(); i++) { if (thisStr.charAt(i) == '^') { i++; if ((i + 1) < thisStr.length()) { final int tagStart = i; final char c = thisStr.charAt(i); if ((c == '<') || (c == '&')) ... |
int | lengthMinusTrailingWhitespace(String line) Returns the length of a string ignoring all trailing whitespace. int len = line.length(); for (int i = len - 1; i >= 0; i--) { if (!Character.isWhitespace(line.charAt(i))) { break; len--; return len; ... |
int | lengthOfCommonPrefix(String s1, String s2) length Of Common Prefix if (s1 == null || s2 == null) return 0; int i = 0; for (; i < Math.min(s1.length(), s2.length()); ++i) { if (s1.charAt(i) != s2.charAt(i)) { break; return i; |
int | lengthOfStartingWhitespace(String s) length Of Starting Whitespace int n = s.length(); for (int i = 0; i < n; i++) { char c = s.charAt(i); if (c != ' ' && c != '\t') { return i; return n; ... |