com.raelity.text
Class TextUtil

java.lang.Object
  extended by com.raelity.text.TextUtil

public class TextUtil
extends Object

Some convenient functions when working with text. This class is not meant to be instantiated, its methods are all static.


Nested Class Summary
static class TextUtil.MySegment
          To support jdk1.5, need a segment that isa CharSequence.
 
Constructor Summary
TextUtil()
           
 
Method Summary
static String debugString(String s)
          replace control characters with something visible, only handle \n for now.
static Vector split(String s)
          Split a string into a vector of words.
static Vector split(String s, String separators)
          Split a string into a vector of words, using separarators to delineate the words.
static String toString(CharacterIterator ci)
           
static String toString(CharacterIterator ci, int index, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtil

public TextUtil()
Method Detail

split

public static Vector split(String s)
Split a string into a vector of words. White space is used for the delimeters, " \t\n\r".


split

public static Vector split(String s,
                           String separators)
Split a string into a vector of words, using separarators to delineate the words.


toString

public static String toString(CharacterIterator ci)

toString

public static String toString(CharacterIterator ci,
                              int index,
                              int len)

debugString

public static String debugString(String s)
replace control characters with something visible, only handle \n for now.