This class contains a number of static methods that can be helpful in handling buffer text.
public static int findMatchingBracket
(Buffer buffer, int line, int offset);
Returns the offset of the bracket matching the one at offset offset of line line of the buffer; returns -1 if the bracket is unmatched or if the specified character is not a bracket.
public static int findWordStart
(String line, int pos, String noWordSep);
public static int findWordEnd
(String line, int pos, String noWordSep);
Returns the position on which the word found on line line, position line begins or ends. The parameter noWordSep contains those non-alphanumeric characters that will be treated as part of a word for purposes of finding the beginning or end of word (such as an underscore character).
public static String format
(String text, int maxLineLength);
Reformats a string and inserts line separators as necessary so that no line exceeds maxLineLength in length.
public static String spacesToTabs
(String in, int tabSize);
public static String tabsToSpaces
(String in, int tabSize);
Makes the indicated change based upon a tab size of tabSize.