|
|||||||||
| 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 String |
escapeSpaces(String aPathString)
Escapes all white Space Characters |
static String |
getPlatformEncoding()
|
static String |
listToString(List<?> aStringList)
Transforms a (Array)List of Strings into a line.separator="\n" separated Stringlist. |
static String |
listToString(List<?> aStringList,
String aLineSeparator)
Transforms a (Array)List of Strings into an aLineSeparator separated Stringlist. |
static String |
normalizePath(String destination)
Normalizes a mixed Windows/Unix Path. |
static String |
normalizePath(String destination,
String fileSeparator)
Normalizes a Windows or Unix Path. |
static String |
replace(String value,
String from,
String to)
Replaces from with to in given String: value |
static String |
replace(String value,
String from,
String to,
boolean aCaseSensitiveFlag)
Replaces from with to in given String: value |
static String |
replaceOrEscapeAll(String aPathString,
String replaceOrEscapeWith,
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 String |
replaceSpaces(String aPathString,
String replaceWith)
Escapes all white Space Characters |
static String |
replaceSpacesWithMinus(String aPathString)
Escapes all white Space Characters |
static boolean |
startsWith(String str,
String prefix)
True if a given string starts with the another given String |
static boolean |
startsWithIgnoreCase(String str,
String prefix)
The same as startsWith but ignores the case. |
static String |
stringArrayToSpaceSeparatedString(String[] args)
Converts an String Array to a space separated String w/o any check |
static 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 String replace(String value,
String from,
String to)
value - original Stringfrom - Search Patternto - Replace with this
public static String replace(String value,
String from,
String to,
boolean aCaseSensitiveFlag)
value - original Stringfrom - Search Patternto - Replace with thisaCaseSensitiveFlag - set to true be case sensitive.
public static String escapeSpaces(String aPathString)
aPathString -
public static String replaceSpacesWithMinus(String aPathString)
aPathString -
public static String replaceSpaces(String aPathString,
String replaceWith)
aPathString -
public static String replaceOrEscapeAll(String aPathString,
String replaceOrEscapeWith,
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 String normalizePath(String destination,
String fileSeparator)
destination - fileSeparator - a target-system fileseparator
public static String normalizePath(String destination)
destination - accepted mixed form by java.File like "C:/a/mixed\path\accepted/by\Java"
public static String stringArrayToSpaceSeparatedString(String[] args)
args - The StringArray
public static String getPlatformEncoding()
public static String UTF16()
public static String listToString(List<?> aStringList)
aStringList -
public static String listToString(List<?> aStringList,
String aLineSeparator)
aStringList -
public static boolean startsWith(String str,
String prefix)
str - The String to search inprefix - The string to search for
public static boolean startsWithIgnoreCase(String str,
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 | ||||||||