List of utility methods to do Tab Expand
String | expandTabs(int ntabs) expand Tabs StringBuffer tabs = new StringBuffer(); for (int i = 0; i < ntabs; i++) tabs.append(' '); return tabs.toString(); |
String | expandTabs(String inputString, int numberOfSpaces) expand Tabs if (inputString.indexOf('\t') == -1) return inputString; int inputStringLength = inputString.length(); StringBuffer buffer = new StringBuffer(inputStringLength); String spaces = nCopies(numberOfSpaces, ' '); for (int i = 0; i < inputStringLength; i++) { char c = inputString.charAt(i); if (c == '\t') ... |
String | expandTabs(String s, int tabSize) expand Tabs if (s == null) return null; StringBuilder buf = new StringBuilder(); int col = 0; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); switch (c) { case '\n': ... |
String | expandTabs(String str) expand Tabs return str.replace("\t", " "); |
StringBuffer | expandTabs(String string, int tabSize) Expands the given string's tabs according to the given tab size. StringBuffer expanded = new StringBuffer(); for (int i = 0, n = string.length(), chars = 0; i < n; i++) { char ch = string.charAt(i); if (ch == '\t') { for (; chars < tabSize; chars++) expanded.append(' '); chars = 0; } else { ... |
String | expandTabs(String text, int tabSize) expand Tabs String rv = ""; if (text != null) { if (text.indexOf('\t') >= 0) { StringBuilder buf = new StringBuilder(); int len = text.length(); for (int i = 0; i < len; i++) { char ch = text.charAt(i); if (ch == '\t') { ... |
String | expandTabs(String text, int tabWidth) Same as expandTabs(text, tabWidth, 0) . return expandTabs(text, tabWidth, 0);
|