## org.apache.tools.ant.util
Class StringUtils

    java.lang.Object
      |
      +--org.apache.tools.ant.util.StringUtils

public final class StringUtils
extends java.lang.Object

A set of helper methods related to string manipulation.

Field Summary
`static java.lang.String` `LINE_SEP` the line separator for this OS

Constructor Summary
`StringUtils()`

Method Summary
`static java.lang.String` `getStackTrace(java.lang.Throwable t)` Convenient method to retrieve the full stacktrace from a given exception.
`static java.util.Vector` `lineSplit(java.lang.String data)` Splits up a string into a list of lines.
`static java.lang.String` `replace(java.lang.String data, java.lang.String from, java.lang.String to)` Replace occurrences into a string.
`static java.util.Vector` `split(java.lang.String data, int ch)` Splits up a string where elements are separated by a specific character and return all elements.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LINE_SEP

    public static final java.lang.String LINE_SEP

  the line separator for this OS

Constructor Detail

### StringUtils

    public StringUtils()

Method Detail

### lineSplit

    public static java.util.Vector lineSplit(java.lang.String data)

  Splits up a string into a list of lines. It is equivalent to `split(data, '\n')`.

  Parameters:
    `data` - the string to split up into lines.
  Returns:
    the list of lines available in the string.

### split

    public static java.util.Vector split(java.lang.String data,
                                         int ch)

  Splits up a string where elements are separated by a specific character and return all elements.

  Parameters:
    `data` - the string to split up.
    `ch` - the separator character.
  Returns:
    the list of elements.

### replace

    public static java.lang.String replace(java.lang.String data,
                                           java.lang.String from,
                                           java.lang.String to)

  Replace occurrences into a string.

  Parameters:
    `data` - the string to replace occurrences into
    `from` - the occurrence to replace.
    `to` - the occurrence to be used as a replacement.
  Returns:
    the new string with replaced occurrences.

### getStackTrace

    public static java.lang.String getStackTrace(java.lang.Throwable t)

  Convenient method to retrieve the full stacktrace from a given exception.

  Parameters:
    `t` - the exception to get the stacktrace from.
  Returns:
    the stacktrace from the given exception.

Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.