org.telscenter.pas.common.ui
Class StringUtils

java.lang.Object
  extended by org.telscenter.pas.common.ui.StringUtils

public class StringUtils
extends java.lang.Object

General purpose class containing common String manipulation methods.

Since:
1.0
Version:
$Revision: 3315 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
StringUtils()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static java.lang.String wordWrap(java.lang.String input, int width, java.util.Locale locale)
          Reformats a string where lines that are longer than width are split apart at the earliest wordbreak or at maxLength, whichever is sooner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

wordWrap

public static java.lang.String wordWrap(java.lang.String input,
                                        int width,
                                        java.util.Locale locale)
Reformats a string where lines that are longer than width are split apart at the earliest wordbreak or at maxLength, whichever is sooner. If the width specified is less than 5 or greater than the input Strings length the string will be returned as is.

Please note that this method can be lossy - trailing spaces on wrapped lines may be trimmed.

Parameters:
input - the String to reformat.
width - the maximum length of any one line.
Returns:
a new String with reformatted as needed.

main

public static void main(java.lang.String[] args)


Copyright © 2004-2008 TELS Center. All Rights Reserved.