public class StringUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StringUtil.StringReplacer
class that provides additional functionality for replacing string
|
Modifier and Type | Field and Description |
---|---|
static String |
m_URIEscape
Deprecated.
use
UrlUtil .m_URIEscape |
static String |
UTF8 |
Modifier and Type | Method and Description |
---|---|
static String |
addToken(String strWork,
String delim,
String newToken)
replace a token in a string
|
static int |
compareTo(double d1,
double d2)
return -1 if d1 < d2 , 0 if d1==d2 ; +1 if d1>d2 are within a range of epsilon or close enough to be serialized identically
|
static void |
concatStrings(VString vS,
String appendString)
add the string appendString to all Strings in VString vs
|
static String |
createString(InputStream is)
create a string from an input stream
|
static boolean |
equals(String a,
String b)
return true if a equals b or both are null or ""
|
static byte[] |
escape(byte[] a_toEscape,
String strCharSet,
String strEscapeChar,
int iRadix,
int iEscapeLen,
int iEscapeBelow,
int iEscapeAbove)
escape a string by prepending escapeChar and a numerical representation of the string.
|
static String |
escape(String strToEscape,
String strCharSet,
String strEscapeChar,
int iRadix,
int iEscapeLen,
int iEscapeBelow,
int iEscapeAbove)
escape a string by prepending escapeChar and a numerical representation of the string.
|
static String |
extension(String pathName)
Deprecated.
use URLUtil.extension
|
static String |
fileToUrl(File f,
boolean b)
Deprecated.
use UrlUtil.fileToUrl(f, b);
|
static int |
find_last_not_of(String strWork,
String strNotList)
find the last character in strwork that is not in strNotList
|
static String |
formatDouble(double d)
returns a formatted double.
|
static String |
formatDouble(double value,
int precision)
returns a formatted double.
|
static String |
formatInteger(int i)
returns a formatted integer, replaces string constants with according int constants
|
static String |
formatLong(long i)
returns a formatted integer, replaces string constants with according int constants
|
static String |
getDefaultNull(String s,
String def)
return null if s==null or s==def, else s
used e.g. to zapp "" strings |
static int |
getDistance(String s1,
String s2,
boolean normalize,
boolean ignoreCase,
boolean ignoreEmpty)
return the Levenschtein ditance where null is treated as ""
|
static Vector<org.apache.commons.lang.enums.ValuedEnum> |
getEnumsVector(Class<? extends org.apache.commons.lang.enums.ValuedEnum> e)
Deprecated.
use @se EnumUtil.getEnumsVector
|
static byte[] |
getHexBinaryBytes(byte[] unicodeArray)
Decode a HexBinary encoded byte array back to Unicode
|
static VString |
getNamesVector(Class<? extends org.apache.commons.lang.enums.ValuedEnum> e)
Deprecated.
use @see EnumUtil.getNamesVector
|
static String |
getNonEmpty(String s)
return null if s==null or s=="", else s
used e.g. to zapp "" strings |
static String |
getRandomString()
returns a random string for testing fun stuff - similar to unix fortune but biased towards monty python or the hitchhikers guide to the galaxy
|
static byte[] |
getRawBytes(String strUnicode)
get the raw bytes specified in strUnicode, bypassing all transcoders
any character values above 255 is truncated (c=c&0xff) |
static String |
getRelativePath(File f,
File fCWD)
Deprecated.
use URLUtil.getRelativePath(f, fCWD);
|
static String |
getRelativeURL(File f,
File baseDir)
Deprecated.
use getRelativeURL(File f, File fCWD, boolean bEscape128)
|
static String |
getRelativeURL(File f,
File baseDir,
boolean bEscape128)
Deprecated.
use URLUtil.getRelativeURL
|
static byte[] |
getUTF8Bytes(String strUnicode)
return the UTF8 String
strUnicode as Unicode byte array |
static String |
getUTF8String(byte[] utf8)
get the unicode string representing the UTF8 representation of the byte buffer fall back on default encoding in case someone accidentally sends in non
utf-8
|
static boolean |
hasToken(String[] strWork,
String token,
int iSkip)
check whether a vector of Strings contains a given token
default: hasToken(strWork, token, 0)
|
static boolean |
hasToken(String strWork,
String token,
String delim)
Deprecated.
use the 4 parameter version
|
static boolean |
hasToken(String strWork,
String token,
String delim,
int iSkip)
check whether a String contains a given token
default: hasToken(strWork, token, delim, 0)
|
static int |
indexOfToken(String strWork,
String token,
String delim,
int start)
index of a token in a string
|
static boolean |
isBoolean(String strWork)
checks whether a string matches the boolean values "true" or "false"
|
static boolean |
isEmpty(String s)
return true if s==null or s=="", else s
|
static boolean |
isEqual(double d1,
double d2)
return true if d1 and d2 are within a range of epsilon or close enough to be serialized identically
|
static boolean |
isID(String strWork)
checks whether a string is an ID
|
static boolean |
isInteger(String str)
checks whether
str reprents an integer |
static boolean |
isNMTOKEN(String strWork)
checks whether a string is a NMTOKEN
|
static boolean |
isNMTOKENS(String strWork)
Deprecated.
060309 use isNMTOKENS(strWork,false)
|
static boolean |
isNMTOKENS(String strWork,
boolean bID)
checks whether a string is a NMTOKENS list
|
static boolean |
isNumber(String str)
checks whether a string is a number
|
static boolean |
isUNC(String pathName)
Deprecated.
use URLUtil.isUNC(pathName)
|
static boolean |
isWindowsLocalPath(String pathName)
Deprecated.
use UrlUtil.isWindowsLocalPath(pathName);
|
static String |
leftStr(String strWork,
int n)
n > 0 substring(0, n) take the first n chars (leftmost) n < 0 substring(0, s.length()+n) take the string and cut n chars on the right example: string =
"abcdefgh" string.leftStr( 2) = "ab" string.leftStr(-3) = "abcde"
|
static boolean |
matches(String str,
String regExp)
match a regular expression using String.matches(), but also catch exceptions
does NOT handle simplified regexp.
|
static boolean |
matchesIgnoreCase(String str,
String regExp)
match a regular expression using ignoring cases using String.matches(), but also catch exceptions and handle simplified regexp.
|
static boolean |
matchesSimple(String str,
String regExp)
match a regular expression using String.matches(), but also catch exceptions and handle simplified regexp.
|
static String |
mime(String strWork)
Deprecated.
use MimeUtil.getMimeTypeFromExt(strWork);
|
static String |
newExtension(String strWork,
String newExt)
Deprecated.
use UrlUtil.newExtension
|
static String |
normalize(String strWork,
boolean toLower)
normalize a string by stripping and converting any internal whitespace to a single blank
|
static String |
normalize(String strWork,
boolean toLower,
String replace)
normalize a string by stripping and converting any internal whitespace to the value of replace
|
static int |
numSubstrings(String strWork,
String subString)
counts the number of occurrences of subString in String
the total number of occurrences is counted, e.g "aaa" contains "aa" twice
|
static boolean |
parseBoolean(String s,
boolean def)
parses a string to boolean and catches any format exception
"1" and "0" are treated as true and false respectively
|
static double |
parseDouble(String s,
double def)
parses a string to double and catches any format exception
|
static int |
parseInt(String s,
int def)
parses a string to integer and catches any format exception
|
static long |
parseLong(String s,
long def)
parses a string to long and catches any format exception
|
static String |
pathToName(String pathName)
gets the file name from a path - regardless of the OS syntax that the path is declared in
|
static int |
posOfToken(String strWork,
String name,
String separator,
int iSkip)
returns the position of the token, if it is in the String.
|
static String |
prefix(String strWork)
Deprecated.
use UrlUtil.prefix(strWork);
|
static String |
removeToken(String strWork,
int index,
String delim)
replace a token in a string
|
static String |
removeToken(String strWork,
String oldToken,
String delim) |
static String |
replaceChar(String strWork,
char c,
String replaceString,
int offset)
replace multiple occurrences of a character in a given String
default: replaceChar(strWork, c, s, 0)
|
static String |
replaceCharSet(String strWork,
String charSet,
String replaceString,
int offset)
replace any of a set of characters in a given String
default: replaceCharSet(strWork, c, s, 0)
|
static String |
replaceString(String strWork,
String toReplace,
String replaceBy)
replace a string in a given String if the replacement string is contained by the string to replace, recursively replace until no ocurrences of the
original remain thus replaceString("a000000", "00", "0") will return "a0" rather than "a000"
|
static String |
replaceToken(String strWork,
int index,
String delim,
String newToken)
replace a token in a string
|
static String |
replaceToken(String strWork,
String oldToken,
String delim,
String newToken) |
static String |
rightStr(String strWork,
int n)
get the end of a string n > 0 str.substring(str.length() - n) take the rightmost n chars n < 0 substring(-n) take the string and cut n chars on the left
example: string = "abcdefgh" string.rightStr( 2) = "gh" string.rightStr(-3) = "defgh"
|
static String |
setHexBinaryBytes(byte[] buffer,
int len)
get buffer as HexBinary
any character values above 255 is truncated |
static String |
setRawBytes(byte[] buffer,
int len)
set a string to the raw bytes specified in buffer, bypassing all transcoders
|
static byte[] |
setUTF8String(String strUnicode)
Deprecated.
use getUTF8Bytes instead
|
static String |
setvString(List<?> v)
create a string from a vector of tokens
default: setvString(v, JDFConstants.BLANK, null, null)
|
static String |
setvString(List<?> v,
String sep,
String front,
String back)
create a string from a vector of tokens
|
static String |
setvString(String[] a,
String sep,
String front,
String back)
create a string from an array of tokens
|
static String |
simpleRegExptoRegExp(String simpleRegExp)
converts a simple regexp to a real regexp
* --> (.*) (any # of chars) . --> \. |
static String |
sprintf(String format,
Object[] objects)
format a string using C++ sprintf functionality
|
static String |
sprintf(String format,
String template)
format a string using C++ sprintf functionality
|
static String |
stripNot(String work,
String keepChars)
returns a new string that has all characters stripped from work that are not in keepChars
|
static String |
stripPrefix(String str,
String prefix,
boolean bIgnoreCase)
strip a prefix, if it is there else return the string
|
static String |
stripQuote(String str,
String quote,
boolean bTrim)
strip leading and trailing quotes from a string
|
static String |
substring(String strWork,
int first,
int last)
similar to substring but also null safe and allowing negative numbers to count backwards
|
static String |
token(String strWork,
int index,
String delim)
get a single token from a String
default: Token(strWork, index," \t\n")
|
static VString |
tokenize(String strWork,
String delim,
boolean delim2token)
return a vector of individual tokens
Multiple consecutive delimitors are treated as one (similar to whitespace handling). |
static VString |
tokenizeBrackets(String strWork,
char delimIn,
char delimOut)
tokenize while counting the referenced in and out so that internal tokens are skipped
used e.g for "?
|
static String |
trim(String work,
String trimChars)
returns a new string that has all characters trimmed from the front and back of work that are not in trimChars
|
static String |
uncToUrl(String unc,
boolean bEscape128)
Convert a UNC path to a valid file URL or IRL note that some internal functions use network protocol and therefor performance may be non-optimal
|
static byte[] |
unEscape(byte[] byteUnEscape,
String strEscapeChar,
int iRadix,
int escapeLen)
unescape a String which was escaped with the Java StringUtil.escape method
|
static String |
unEscape(String strToUnescape,
String strEscapeChar,
int iRadix,
int escapeLen)
unescape a String which was escaped with the Java StringUtil.escape method
|
static String |
vStringToString(VString vs)
Deprecated.
use vs.getString(" ",null,null)
|
static String |
wipeInvalidXML10Chars(String strText,
String replace)
replaces all chars that are not compatible with xml1.0
|
static String |
xmlNameEscape(String strWork) |
static String |
xmlNameSpace(String strWork)
Deprecated.
060314 use KElement.xmlnsprefix
|
static String |
zappTokenWS(String str,
String delim)
Returns a string with deleted whitespaces near 'delim' and from the both ends of the string (if they were there)
tokenizes a given string 'str' into tokens without separators. |
public static final String UTF8
@Deprecated public static final String m_URIEscape
UrlUtil
.m_URIEscapepublic static String getRandomString()
public static String zappTokenWS(String str, String delim)
str
- working stringdelim
- the delimiterpublic static String sprintf(String format, String template)
format
- the format to print, see C++ spec for detailstemplate
- - comma separated string - the values are parsed and the appropriate objects are created more objects exist in template than the number
of '%' tokens in format, the remainder of objects is ignored duplicate '\\,' is taken as literal ','IllegalArgumentException
- in case format and o do not match, i.e. not enough objects are passed to fill formatpublic static String sprintf(String format, Object[] objects)
format
- the format to print, see C++ spec for detailsobjects
- the array of objects, either String, Double, Integer or ValuedEnum, if objects is longer than the number of '%' tokens in format, the
remainder of objects is ignored The method works fairly loosely typed, thus doubles are printed as integers, Strings are converted to numbers, if
possible etc.IllegalArgumentException
- in case format and o do not match, i.e. not eough objects are passed to fill formatpublic static String setvString(String[] a, String sep, String front, String back)
a
- the token arraysep
- the separator between the tokensfront
- the front end of the stringback
- the back end of the stringpublic static String setvString(List<?> v)
default: setvString(v, JDFConstants.BLANK, null, null)
v
- the token vectorpublic static String setvString(List<?> v, String sep, String front, String back)
v
- the token vectorsep
- the separator between the tokensfront
- the front end of the stringback
- the back end of the stringpublic static String leftStr(String strWork, int n)
strWork
- the string to work onn
- number of characters to cut (negative) or retain (positive)public static String substring(String strWork, int first, int last)
strWork
- the string to work onfirst
- the position of the starting character 0=firstlast
- the position of the end character 0=lastpublic static String rightStr(String strWork, int n)
strWork
- the string to work onn
- number of characters to cut (negative) or retain (positive)public static VString tokenize(String strWork, String delim, boolean delim2token)
default: tokenize(strWork, delim, false)
strWork
- the string to tokenizedelim
- the delimiter, if null use whitespacedelim2token
- should a delimiter be a token?public static VString tokenizeBrackets(String strWork, char delimIn, char delimOut)
strWork
- delimIn
- thedelimOut
- public static boolean hasToken(String strWork, String token, String delim, int iSkip)
default: hasToken(strWork, token, delim, 0)
strWork
- the string to work ontoken
- the token to search fordelim
- the delimiter of the tokensiSkip
- the number of matching tokens to skip before returning truestrWork
contains token
public static boolean hasToken(String[] strWork, String token, int iSkip)
default: hasToken(strWork, token, 0)
strWork
- the vector of strings string to work ontoken
- the token to search foriSkip
- the number of matching tokens to skip before returning truestrWork
contains token
public static String addToken(String strWork, String delim, String newToken)
strWork
- the String to work ondelim
- the delimiternewToken
- the new token, if null said token is removedpublic static String removeToken(String strWork, int index, String delim)
strWork
- the String to work onindex
- index of the token to replace
if<0 return from end (e.g. -1 is the last token)delim
- the delimiterpublic static String replaceToken(String strWork, String oldToken, String delim, String newToken)
strWork
- oldToken
- delim
- newToken
- public static String removeToken(String strWork, String oldToken, String delim)
strWork
- oldToken
- delim
- newToken
- public static String replaceToken(String strWork, int index, String delim, String newToken)
strWork
- the String to work onindex
- index of the token to replace
if<0 return from end (e.g. -1 is the last token)delim
- the delimiternewToken
- the new token, if null said token is removedpublic static String token(String strWork, int index, String delim)
strWork
- the String to work onindex
- index of the token to returndelim
- the delimiternull
if no token found)public static String replaceCharSet(String strWork, String charSet, String replaceString, int offset)
default: replaceCharSet(strWork, c, s, 0)
strWork
- String to work oncharSet
- characters to replacereplaceString
- String to insert for any character in charSet, if null simply remove all occurrences of any char in charSetoffset
- where to start replacingpublic static String replaceChar(String strWork, char c, String replaceString, int offset)
default: replaceChar(strWork, c, s, 0)
strWork
- String to work onc
- character to replacereplaceString
- String to insert for c, if null simply remove coffset
- public static String replaceString(String strWork, String toReplace, String replaceBy)
strWork
- String to work ontoReplace
- String to match and replacereplaceBy
- String to insert for toReplace, null if nothing should be insertedpublic static String xmlNameEscape(String strWork)
strWork
- @Deprecated public static String extension(String pathName)
pathName
- @Deprecated public static String prefix(String strWork)
strWork
- the string to work onpublic static String normalize(String strWork, boolean toLower)
strWork
- the inputtoLower
- if true return all lower casepublic static String normalize(String strWork, boolean toLower, String replace)
strWork
- the inputtoLower
- if true return all lower casereplace
- the replace character, if null remove all whitespacepublic static String getDefaultNull(String s, String def)
s
- the String to testdef
- the default that is converted to nullpublic static int getDistance(String s1, String s2, boolean normalize, boolean ignoreCase, boolean ignoreEmpty)
s1
- s2
- normalize
- if true, normalize strings prior to calculatingignoreCase
- if true, ignore case strings when calculatingignoreEmpty
- if true, the result is 0 if one of the two strings is null or ""public static String getNonEmpty(String s)
s
- the String to testpublic static boolean isEmpty(String s)
s
- @Deprecated public static String newExtension(String strWork, String newExt)
strWork
- the file pathnewExt
- the new extension (works with or without the initial "."@Deprecated public static String xmlNameSpace(String strWork)
strWork
- @Deprecated public static String mime(String strWork)
strWork
- String to work inpublic static boolean isNMTOKEN(String strWork)
strWork
- the string to checkpublic static boolean isID(String strWork)
strWork
- the string to checkpublic static boolean isEqual(double d1, double d2)
d1
- d2
- public static int compareTo(double d1, double d2)
d1
- d2
- @Deprecated public static boolean isNMTOKENS(String strWork)
strWork
- the string to checkpublic static boolean isNMTOKENS(String strWork, boolean bID)
strWork
- the string to checkbID
- if true, also check that each individual token matches the pattern for an IDpublic static boolean isBoolean(String strWork)
strWork
- the string to checkpublic static boolean isNumber(String str)
str
- the string to checkpublic static String wipeInvalidXML10Chars(String strText, String replace)
strText
- the text to checkreplace
- the single char string to replace non xml chars with; if null the non-xml char is simply omittedpublic static int find_last_not_of(String strWork, String strNotList)
strWork
- the string to searchstrNotList
- the list of characters to ignorepublic static int posOfToken(String strWork, String name, String separator, int iSkip)
strWork
- the string to work onname
- the token to searchseparator
- separatoriSkip
- number of tokens to skip before accepting (if 0 -> take the first etc., -1 -> first as well)@Deprecated public static boolean hasToken(String strWork, String token, String delim)
default: hasToken(strWork, token, delim)
strWork
- the string to work ontoken
- the token to search fordelim
- the delimiter of the tokenspublic static int indexOfToken(String strWork, String token, String delim, int start)
strWork
- the string to work ontoken
- the token to search fordelim
- the delimiter of the tokensstart
- position to search in the stringpublic static int numSubstrings(String strWork, String subString)
strWork
- subString
- public static String setRawBytes(byte[] buffer, int len)
buffer
- the buffer to assign to this
len
- public static byte[] getRawBytes(String strUnicode)
strUnicode
- the unicode stringpublic static String setHexBinaryBytes(byte[] buffer, int len)
buffer
- the String which you want to encode to HexBinarylen
- the length of the buffer. public static byte[] getHexBinaryBytes(byte[] unicodeArray)
unicodeArray
- array which stores the HexBinarypublic static byte[] getUTF8Bytes(String strUnicode)
strUnicode
as Unicode byte arraystrUnicode
- the unicode string to transcode to utf8null
if an error occurred@Deprecated public static byte[] setUTF8String(String strUnicode)
strUnicode
- public static String getUTF8String(byte[] utf8)
utf8
- the utf-8 encoded byte arraynull
if an error occurrredpublic static String formatDouble(double d)
d
- the double to formatpublic static String formatInteger(int i)
i
- the integer to formatpublic static String formatLong(long i)
i
- the integer to formatpublic static boolean isInteger(String str)
str
reprents an integerstr
- the String to checkpublic static String escape(String strToEscape, String strCharSet, String strEscapeChar, int iRadix, int iEscapeLen, int iEscapeBelow, int iEscapeAbove)
default: escape(String toEscape, null, 0, 0, 0, 256); //Note that an escaped character can't be unescaped without the knowledge of the escapelength
strToEscape
- the String to escapestrCharSet
- the set of characters that should be escaped eg "äöüß$€"strEscapeChar
- the character sequence that marks an escape sequence. If null
, "\\" is usediRadix
- the numerical representation base of the escaped chars, e.g. 8 for octal, 16 for hexiEscapeLen
- the number of digits per escaped char, not including escapeChariEscapeBelow
- all characters with an encoding below escapeBelow should also be escaped, if negative, no lower limit appliesiEscapeAbove
- all characters with an encoding above escapeAbove should also be escaped, if negative, no upper limit appliespublic static boolean equals(String a, String b)
a
- String to compareb
- String to comparepublic static byte[] escape(byte[] a_toEscape, String strCharSet, String strEscapeChar, int iRadix, int iEscapeLen, int iEscapeBelow, int iEscapeAbove)
default: escape(String toEscape, null, 0, 0, 0, 256); //Note that an escaped character can't be unescaped without the knowledge of the escapelength
a_toEscape
- the bytes to escapestrCharSet
- the set of characters that should be escaped eg "äöüß$€"strEscapeChar
- the character sequence that marks an escape sequence. If null
, "\\" is usediRadix
- the numerical representation base of the escaped chars, e.g. 8 for octal, 16 for hexiEscapeLen
- the number of digits per escaped char, not including escapeChariEscapeBelow
- all characters with an encoding below escapeBelow should also be escaped, if negative, no lower limit appliesiEscapeAbove
- all characters with an encoding above escapeAbove should also be escaped, if negative, no upper limit appliespublic static String unEscape(String strToUnescape, String strEscapeChar, int iRadix, int escapeLen)
strToUnescape
- the String to unescape. For example zz\d6\zzz\c4\\dc\z\d6\\24\\3f\zz�z
strEscapeChar
- the char which indicates a escape sequence "\\" in this case (thats also the default)iRadix
- the radix of the escape sequenze. 16 in this example.escapeLen
- the number of digits per escaped char, not including strEscapeCharpublic static byte[] unEscape(byte[] byteUnEscape, String strEscapeChar, int iRadix, int escapeLen)
byteUnEscape
- the bytes to unescape. For example zz\d6\zzz\c4\\dc\z\d6\\24\\3f\zz�z
strEscapeChar
- the char which indicates a escape sequence "\\" in this case (thats also the default)iRadix
- the radix of the escape sequenze. 16 in this example.escapeLen
- the number of digits per escaped char, not including strEscapeCharzz�zzz��z�$?zz�z
in this example@Deprecated public static String vStringToString(VString vs)
vs
- public static double parseDouble(String s, double def)
s
- the string to parsedef
- the default to return in case of errorpublic static boolean parseBoolean(String s, boolean def)
s
- the string to parsedef
- the default to return in case of errorpublic static int parseInt(String s, int def)
s
- the string to parsedef
- the default to return in case of errorpublic static long parseLong(String s, long def)
s
- the string to parsedef
- the default to return in case of errorpublic static String uncToUrl(String unc, boolean bEscape128)
unc
- The UNC string to parse, may also be used for local charactersbEscape128
- if true, escape non -ascii chars (URI), if false, don't (IRI)public static String pathToName(String pathName)
pathName
- @Deprecated public static boolean isWindowsLocalPath(String pathName)
pathName
- @Deprecated public static boolean isUNC(String pathName)
pathName
- public static String simpleRegExptoRegExp(String simpleRegExp)
simpleRegExp
- the simple regexppublic static boolean matchesSimple(String str, String regExp)
null
expression is assumed to
match anything.str
- the string to matchregExp
- the expression to match againstpublic static boolean matches(String str, String regExp)
null
expression is assumed to
match anything.str
- the string to matchregExp
- the expression to match againstpublic static boolean matchesIgnoreCase(String str, String regExp)
null
expression is assumed to match anything.str
- the string to matchregExp
- the simplified expression to match againstpublic static void concatStrings(VString vS, String appendString)
vS
- the string vectorappendString
- the string to appendpublic static String createString(InputStream is)
is
- the input stream@Deprecated public static String getRelativeURL(File f, File baseDir)
f
- the file to get the relative url forbaseDir
- the file that describes cwd, if null cwd is calculated@Deprecated public static String getRelativeURL(File f, File baseDir, boolean bEscape128)
f
- the file to get the relative url forbaseDir
- the file that describes cwd, if null cwd is calculatedbEscape128
- if true, escape > 128 (URL) else retain (IRL)@Deprecated public static String getRelativePath(File f, File fCWD)
f
- the file to get the relative path forfCWD
- the file that describes cwd, if null
cwd is calculated@Deprecated public static VString getNamesVector(Class<? extends org.apache.commons.lang.enums.ValuedEnum> e)
e
- any member of the enum to iterate over@Deprecated public static Vector<org.apache.commons.lang.enums.ValuedEnum> getEnumsVector(Class<? extends org.apache.commons.lang.enums.ValuedEnum> e)
e
- any member of the enum to iterate over@Deprecated public static String fileToUrl(File f, boolean b)
f
- b
- public static String stripPrefix(String str, String prefix, boolean bIgnoreCase)
str
- the string to stripprefix
- the prefix to stripbIgnoreCase
- if true ignore the case of the prefixpublic static String stripQuote(String str, String quote, boolean bTrim)
str
- the work stringquote
- the quote characterbTrim
- if true, trim whitespace prior to trimming quotespublic static String stripNot(String work, String keepChars)
work
- keepChars
- public static String trim(String work, String trimChars)
work
- trimChars
- if null - use standard whitespacepublic static String formatDouble(double value, int precision)
value
- precision
- number of digits after the "."Copyright © 2018. All rights reserved.