org.genepattern.util
Class StringUtils

java.lang.Object
  extended byorg.genepattern.util.StringUtils

public class StringUtils
extends java.lang.Object

Static methods for String manipulation


Method Summary
static java.lang.String capitalize(java.lang.String text)
          returns the String with the first character capitalized so wisconsin => Wisconsin
static int countNonEmpty(java.lang.String[] array)
          counts the number of non-null elements that have a trimed length of at least 1
static int getMaxLineCount(java.lang.String text)
          finds the longest string and returns the number of characters
static int getNumOccurances(java.lang.String text, char delim)
          gets the number of times the delimiter is present in the String
static int getNumOccurances(java.lang.String text, java.lang.String delim)
          gets the number of times the delimiter is present in the String
static java.lang.String htmlEncode(java.lang.String nonHTMLsrc)
          escapes characters that have an HTML entity representation.
static java.lang.String replaceAll(java.lang.String source, java.lang.String find, java.lang.String replace)
          returns a new String where all occurances of the first string are replaced with the second string
static java.lang.String[] splitStrings(java.lang.String text, char delim)
          creates an array of Strings by parsing the input String using the delimiter
static java.lang.String[] splitStrings(java.lang.String text, java.lang.String delim)
          creates an array of Strings by parsing the input String using the delimiter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceAll

public static final java.lang.String replaceAll(java.lang.String source,
                                                java.lang.String find,
                                                java.lang.String replace)
returns a new String where all occurances of the first string are replaced with the second string


splitStrings

public static final java.lang.String[] splitStrings(java.lang.String text,
                                                    char delim)
creates an array of Strings by parsing the input String using the delimiter


splitStrings

public static final java.lang.String[] splitStrings(java.lang.String text,
                                                    java.lang.String delim)
creates an array of Strings by parsing the input String using the delimiter


getNumOccurances

public static final int getNumOccurances(java.lang.String text,
                                         char delim)
gets the number of times the delimiter is present in the String


getNumOccurances

public static final int getNumOccurances(java.lang.String text,
                                         java.lang.String delim)
gets the number of times the delimiter is present in the String


countNonEmpty

public static final int countNonEmpty(java.lang.String[] array)
counts the number of non-null elements that have a trimed length of at least 1


capitalize

public static final java.lang.String capitalize(java.lang.String text)
returns the String with the first character capitalized so wisconsin => Wisconsin


getMaxLineCount

public static final int getMaxLineCount(java.lang.String text)
finds the longest string and returns the number of characters


htmlEncode

public static final java.lang.String htmlEncode(java.lang.String nonHTMLsrc)
escapes characters that have an HTML entity representation. It uses a quick string -> array mapping to avoid creating thousands of temporary objects.

Parameters:
nonHTMLsrc - String containing the text to make HTML-safe
Returns:
String containing new copy of string with ENTITIES escaped