Class StringUtils

java.lang.Object
com.enterprisedt.util.StringUtils

public class StringUtils extends Object
Various useful string utilities
Version:
$Revision$
Author:
Bruce Blackshaw
  • Constructor Details

    • StringUtils

      public StringUtils()
  • Method Details

    • replaceAll

      public static String replaceAll(String text, String from, String to)
      Replaces all occurrences of 'from' in 'text' with 'to'. Used when writing code for JDK 1.1.
      Parameters:
      text - String to replace substrings in.
      from - String to search for.
      to - String to replace with.
      Returns:
      String with all occurrences of 'from' substituted with 'to'.
    • split

      public static String[] split(String str)
      Splits string consisting of fields separated by whitespace into an array of strings. Yes, we could use String.split() but this would restrict us to 1.4+
      Parameters:
      str - string to split
      Returns:
      array of fields
    • split

      public static String[] split(String str, char token)
      Splits string consisting of fields separated by whitespace into an array of strings. Yes, we could use String.split() but this would restrict us to 1.4+
      Parameters:
      str - string to split
      Returns:
      array of fields