fedora.server.utilities
Class StringUtility
java.lang.Object
fedora.server.utilities.StringUtility
- public class StringUtility
- extends java.lang.Object
Title: StringUtility.java
Description: A utility class for common string operations.
- Version:
- $Id $
- Author:
- rlw@virginia.edu
|
Method Summary |
static void |
main(java.lang.String[] args)
|
static java.lang.String |
prettyPrint(java.lang.String in,
int lineLength,
java.lang.String delim)
Method that attempts to break a string up into lines no longer
than the specified line length. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtility
public StringUtility()
prettyPrint
public static java.lang.String prettyPrint(java.lang.String in,
int lineLength,
java.lang.String delim)
Method that attempts to break a string up into lines no longer
than the specified line length. The string is assumed to consist of tokens
separated by a delimeter. The default delimiter is a space. If the last
token to be added to a line exceeds the specified line length, it is
written on the next line so actual line length is approximate given the
specified line length and the length of tokens in the string.
- Parameters:
in - The input string to be split into lines.lineLength - The maximum length of each line.delim - The character delimiter separating each token in the input
string; if null, defaults to the space character.
- Returns:
- A string split into multiple lines whose lenght is less than the
specified length. Actual length is approximate depending on line
length, token size, and how many complete tokens will fit into
the specified line length.
main
public static void main(java.lang.String[] args)