List of utility methods to do String Indent Format
String | indent(String msg, int size) indent int msgLength; if (msg == null) { msgLength = 0; } else { msgLength = msg.length(); int indentLength = size - msgLength; String indent = ""; ... |
String | indent(String original, int spaces) indent String indent = stringOfChar(' ', spaces); String indented = indent + original; indented = replaceAll(indented, "\r\n", "<<<<.CRLF.>>>>"); indented = replaceAll(indented, "\r", "<<<<.CR.>>>>"); indented = replaceAll(indented, "\n", "<<<<.LF.>>>>"); indented = replaceAll(indented, "<<<<.CRLF.>>>>", "\r\n" + indent); indented = replaceAll(indented, "<<<<.CR.>>>>", "\r" + indent); indented = replaceAll(indented, "<<<<.LF.>>>>", "\n" + indent); ... |
String | indent(String s) indent return s + indentation;
|
String | indent(String s) Indents a string with 4 spaces. return indent(s, 4, true);
|
String | indent(String s) indent return " " + s.trim().replace("\n", "\n "); |
String | indent(String s) indent return new StringBuilder(s.replaceAll("\n", "\n\t")).insert(0, "\t").toString(); |
String | indent(String s, int numBlanks) Inserts blanks at the start of the string. StringBuilder result; int i; result = new StringBuilder(); for (i = 0; i < numBlanks; i++) result.append(" "); result.append(s); return result.toString(); |
String | indent(String str) Indents every line of the String by 1 tab. String[] lines = str.split("\\n"); String newStr = ""; for (String line : lines) { newStr += "\t" + line + "\n"; return newStr; |
String | indent(String str, String indent) indent if (isNullOrEmpty(str)) return str; return indent + str.replaceAll("\n", "\n" + indent); |
String | indent(String string) Indents the given string with one tab. return "\t" + string.replace("\n", "\n\t"); |