StringUtils is a class which has all kinds of static methods for doing useful, common stuff with Strings. Here are a bunch of my favorites: String slurpFile(String filename) String slurpURL(String url) These two get Strings from the contents of files on disk. Not careful about handling errors, but most of the time that's fine. public static void printToFile(String filename, String message, boolean append) This method dumps a String to a file, creating a new file if necessary. If append is false, it will overwrite the file if it exists, if it is true, it will append it. String pad(Object, int) String leftPad(Object, int) Turns an Object into a String, padding it with spaces if necessary in order to get it to be a fixed width. Good for formatting terminal output from programs. Map argsToMap(String[] args) This guy takes command line args and makes them the keys to a Map which may optionally contain values for the args. Makes processing command line args really easy! String escapeString(String s) This allows you to escape some special chars in a String by prefacing it with another special char, which is needed if you want to reserve the special char for something, like quoting. String[] splitOnCharWithQuoting(String s, char splitChar, char quoteChar, char escapeChar) This helps you recover the fields from a string representation of a database record which uses quoting, like Comma Separated Values (CSV) which is read by MS Excel and MS Access. String escapeStringForXML(String s) String unescapeStringForXML(String s) Helpful in dealing with those pesky XML characters, like & and <. Also, a shameless plug: Don't forget about edu.stanford.nlp.math.ArrayMath, which has lot of static methods for doing smart stuff with primitive arrays, like dot product, sum, cosine, KL divergence, etc.! Teg -++**==--++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe java-nlp-list" to