|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.izforge.izpack.util.StringTool
public class StringTool
A extended Java Implementation of Pythons string.replace()
| Constructor Summary | |
|---|---|
StringTool()
Default Constructor |
|
| Method Summary | |
|---|---|
static java.lang.String |
escapeSpaces(java.lang.String aPathString)
Escapes all white Space Characters |
static java.lang.String |
getPlatformEncoding()
|
static void |
main(java.lang.String[] args)
Standalone callable Test method |
static java.lang.String |
normalizePath(java.lang.String destination)
Normalizes a mixed Windows/Unix Path. |
static java.lang.String |
normalizePath(java.lang.String destination,
java.lang.String fileSeparator)
Normalizes a Windows or Unix Path. |
static java.lang.String |
replace(java.lang.String value,
java.lang.String from,
java.lang.String to)
Replaces from with to in given String: value |
static java.lang.String |
replace(java.lang.String value,
java.lang.String from,
java.lang.String to,
boolean aCaseSensitiveFlag)
Replaces from with to in given String: value |
static java.lang.String |
replaceOrEscapeAll(java.lang.String aPathString,
java.lang.String replaceOrEscapeWith,
java.lang.String[] replaceWhat,
boolean escape)
Replaces all given white Space Characters with the replaceOrEscapeWith or Escapes with replaceOrEscapeWith If true was given as Escape-Flag , the Method escapes each whitespace with the replaceOrEscapeWith + replaceWhat[x] Otherwise the replaces each replaceWhat[x] with the replaceOrEscapeWith. |
static java.lang.String |
replaceSpaces(java.lang.String aPathString,
java.lang.String replaceWith)
Escapes all white Space Characters |
static java.lang.String |
replaceSpacesWithMinus(java.lang.String aPathString)
Escapes all white Space Characters |
static boolean |
startsWith(java.lang.String str,
java.lang.String prefix)
True if a given string starts with the another given String |
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String prefix)
The same as startsWith but ignores the case. |
static java.lang.String |
stringArrayListToString(java.util.ArrayList aStringList)
Transforms a (Array)List of Strings into a line.separator="\n" separated Stringlist. |
static java.lang.String |
stringArrayListToString(java.util.ArrayList aStringList,
java.lang.String aLineSeparator)
Transforms a (Array)List of Strings into an aLineSeparator separated Stringlist. |
static java.lang.String |
stringArrayToSpaceSeparatedString(java.lang.String[] args)
Converts an String Array to a space separated String w/o any check |
static java.lang.String |
UTF16()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringTool()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - Commandline Args
public static java.lang.String replace(java.lang.String value,
java.lang.String from,
java.lang.String to)
value - original Stringfrom - Search Patternto - Replace with this
public static java.lang.String replace(java.lang.String value,
java.lang.String from,
java.lang.String to,
boolean aCaseSensitiveFlag)
value - original Stringfrom - Search Patternto - Replace with thisaCaseSensitiveFlag - set to true be case sensitive.
public static java.lang.String escapeSpaces(java.lang.String aPathString)
apathString -
public static java.lang.String replaceSpacesWithMinus(java.lang.String aPathString)
apathString -
public static java.lang.String replaceSpaces(java.lang.String aPathString,
java.lang.String replaceWith)
apathString -
public static java.lang.String replaceOrEscapeAll(java.lang.String aPathString,
java.lang.String replaceOrEscapeWith,
java.lang.String[] replaceWhat,
boolean escape)
aPathString - The input string in which the white space should be handled.replaceOrEscapeWith - The Repace or Escape Char Interpreted depended on the escape FlagreplaceWhat - The atring array with the Characters, which should be replacedescape - The flag, wihch indeicates, how to handle the given replaceOrEscapeWith String.
public static java.lang.String normalizePath(java.lang.String destination,
java.lang.String fileSeparator)
destination - fileSeparator - a target-system fileseparator
public static java.lang.String normalizePath(java.lang.String destination)
destination - accepted mixed form by java.File like "C:/a/mixed\path\accepted/by\Java"
public static java.lang.String stringArrayToSpaceSeparatedString(java.lang.String[] args)
args - The StringArray
public static java.lang.String getPlatformEncoding()
public static java.lang.String UTF16()
public static java.lang.String stringArrayListToString(java.util.ArrayList aStringList)
aStringList -
public static java.lang.String stringArrayListToString(java.util.ArrayList aStringList,
java.lang.String aLineSeparator)
aStringList -
public static boolean startsWith(java.lang.String str,
java.lang.String prefix)
str - The String to search inprefix - The string to search for
public static boolean startsWithIgnoreCase(java.lang.String str,
java.lang.String prefix)
str - The String to search inprefix - The string to search for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||