List of utility methods to do String Format
String | formatStringTo80Columns(String str) Takes a string and formats it so that words are not cut off at the 80 column mark. ArrayList<String> list = new ArrayList<String>(); String[] split = str.split(" "); StringBuffer buffer = new StringBuffer(); for (int count = 0; count < split.length; count++) { String word = split[count]; if ((buffer.length() + word.length() + 1) > 80) { list.add(buffer.toString()); buffer = new StringBuffer(word); ... |
List | formatTooltip(String tooltip) format Tooltip return formatTooltip(tooltip, 45);
|
String | formatTreeLines(String tree) format Tree Lines if (tree == null || tree.equals("")) return tree; StringBuilder reconstructedTree = new StringBuilder(); boolean isOpen = false; for (String s : tree.split(LINE_SEPARATOR)) { List<Integer> insStartIndexes = getIndexesOf(s, "<ins>"); List<Integer> insEndIndexes = getIndexesOf(s, "</ins>"); List<Integer> delStartIndexes = getIndexesOf(s, "<del>"); ... |
void | formatVarname(StringBuilder buffer, Object varname) format Varname if (varname instanceof String) buffer.append((String) varname); else { List varnames = (List) varname; buffer.append("("); int count = 0; for (Object subvarname : varnames) { ++count; ... |
String | formatWords(String words, String delimiter, boolean isHeaderUpperCase) Formats a string list of words delimited to a camel forat: XxxxXxxxXxxx or xxxxXxxxXxxx if (isNullOrEmpty(words)) { return words; List<String> listWords = parseStringList(words, delimiter); return formatWords(listWords, isHeaderUpperCase); |
String | getAnswerKey(String itemFormat) get Answer Key List formats = Arrays.asList("EBSR", "EQ", "NL", "SA", "ER", "GI", "HT", "MI", "TI", "WER", "WORDLIST", "TUT", "SIM", "PASS"); if (formats.contains(itemFormat)) { return itemFormat; } else { return null; |
String | getCodeFileName(String fileNameFormat, String randomCode) get Code File Name return MessageFormat.format(fileNameFormat, randomCode);
|
List | getDBPediaFormatDescriptions(String descriptionStr) get DB Pedia Format Descriptions List<String> descriptions = new ArrayList<String>(); if (descriptionStr != null && descriptionStr.length() > 0) { descriptions.add(descriptionStr); return descriptions; |
String | getEmailFormatError(String fieldPropertyName) get Email Format Error return getPropertyText(fieldPropertyName) + " is not a well-formed email address"; |
String | getFormat(String key, ResourceBundle bundle) Get the format string associated with key in the given resource bundle.
String fmt = "no text found: \"" + key + "\" {0}"; if (bundle != null) { try { fmt = bundle.getString(key); } catch (MissingResourceException e) { return fmt; ... |