uk.org.ogsadai.common
Class StringUtils

java.lang.Object
  |
  +--uk.org.ogsadai.common.StringUtils

public class StringUtils
extends java.lang.Object

Miscellaneous string utilities.

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
 
Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.CharSequence removeDuplicateWhitespace(java.lang.CharSequence inputStr)
          Removes all contiguous whitespace characters, replacing them with a single space.
static java.lang.String stringArrayToString(java.lang.String[] array, java.lang.String separator)
          Conjoin the strings in an array into a single string delimited by a separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values
Constructor Detail

StringUtils

public StringUtils()
Method Detail

stringArrayToString

public static java.lang.String stringArrayToString(java.lang.String[] array,
                                                   java.lang.String separator)
Conjoin the strings in an array into a single string delimited by a separator.

Parameters:
array - The strings to be conjoined.
separator - The string to be used to conjoin the strings.
Returns:
conjoined string or "" if array is null.

removeDuplicateWhitespace

public static java.lang.CharSequence removeDuplicateWhitespace(java.lang.CharSequence inputStr)
Removes all contiguous whitespace characters, replacing them with a single space. Line terminators are treated like whitespace.

Parameters:
inputStr - Characters from which whitespace is to be filtered.
Returns:
the filtered characters.
Throws:
java.lang.IllegalArgumentException - if inputStr is null.
ExternalModuleException - if regular expressions used to effect the replacement are not legal.