Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    An assorted collection of string utilities.
    Version:
    $Id: StringUtils.java,v 1.3 2001/05/30 21:41:14 goetz Exp $
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void printSpaces​(int n, java.io.Writer writer)
      Print n spaces to writer.
      static void printSpaces​(int n, java.lang.StringBuffer buf)
      Print n spaces to buf.
      static java.lang.String replaceAll​(java.lang.String aSourceString, java.lang.String aPattern, java.lang.String aReplaceString)
      Converts occurance of patterns in a sourceString with provided replacement String.
      static void write​(java.io.Writer writer, java.lang.String string)  
      • 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

      • printSpaces

        public static final void printSpaces​(int n,
                                             java.lang.StringBuffer buf)
        Print n spaces to buf.
        Parameters:
        n - Number of spaces to print.
        buf - Buffer to print to.
      • printSpaces

        public static final void printSpaces​(int n,
                                             java.io.Writer writer)
                                      throws java.io.IOException
        Print n spaces to writer.
        Parameters:
        n - Number of spaces to print.
        writer - Writer to print to.
        Throws:
        java.io.IOException - -
      • write

        public static final void write​(java.io.Writer writer,
                                       java.lang.String string)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • replaceAll

        public static java.lang.String replaceAll​(java.lang.String aSourceString,
                                                  java.lang.String aPattern,
                                                  java.lang.String aReplaceString)
        Converts occurance of patterns in a sourceString with provided replacement String.
        Parameters:
        aSourceString - - String to convert
        aPattern - - pattern for matching
        aReplaceString - - replacement String for aPattern
        Returns:
        - converted String