public class TextToolP extends TextToolT
Constructor and Description |
---|
TextToolP() |
Modifier and Type | Method and Description |
---|---|
static char |
capsLower(char cIn)
Changes a character to lower case.
|
static java.lang.String |
capsLower(java.lang.String strIn)
Changes a string to lower case.
|
static char |
capsReverse(char cIn)
Reverses a character to lower case.
|
static java.lang.String |
capsReverse(java.lang.String strIn)
Reverses a string to lower case.
|
static char |
capsUpper(char cIn)
Changes a character to upper case.
|
static java.lang.String |
capsUpper(java.lang.String strIn)
Changes a string to lower case.
|
static int |
compare(java.lang.String str1,
java.lang.String str2)
Performs locale-insensitive comparison.
|
static int |
compare(java.lang.String str1,
java.lang.String str2,
java.util.Locale locale)
Performs locale sensitive comparison.
|
static java.lang.String |
concat(java.lang.Object... o1dArgs)
Connects a bunch of true strings, or strings from ".toString()", or the
mixture of them.
|
static java.lang.String |
convert(java.lang.String strIn,
java.lang.String strSourceEncoding,
java.lang.String strTargetEncoding)
Converts a string from old encoding to new.
|
static java.lang.String |
eatHeadSpaces(java.lang.String strIn)
Eats the SPACEs at the head of a string.
|
static java.lang.String |
eatTailSpaces(java.lang.String strIn)
Eats the SPACEs at the head of a string..
|
static java.lang.String |
format(java.lang.String strPattern,
java.lang.Object[] o1dArgs)
Formats a string with the given pattern and uses it to format the given
arguments.
|
static boolean |
isInScopeIgnoreCase(java.lang.String strGiven,
java.util.Collection<java.lang.String> colScope)
Judges whether the given string is in the given scope, ignore
case.
See MiscToolP.isInScope(Object, Collection) if
the judgment is case sensitive. |
static boolean |
isInScopeIgnoreCase(java.lang.String strGiven,
java.lang.String[] str1dScope)
Judges whether the given string is in the given scope, ignore
case.
See MiscToolP.isInScope(Object, Object[]) if
the judgment is case sensitive. |
static java.lang.String |
n2s(java.lang.String strIn)
Converts to an enpty string while input is null.
|
static java.lang.String |
o2s(java.lang.Object oIn,
java.lang.String strReplacement)
Converts to an empty string while input is null.
|
static java.lang.String |
s2n(java.lang.String strIn)
Converts to null while input is an empty string.
|
static void |
simpleReplace(java.lang.StringBuffer sbIn,
java.lang.String strOldContents,
java.lang.String strNewContents)
Replaces contents from a given string buffer.
|
static void |
simpleReplace(java.lang.StringBuilder sbIn,
java.lang.String strOldContents,
java.lang.String strNewContents)
Replaces contents from a given string builder.
|
static java.lang.String |
simpleReplace(java.lang.String strIn,
java.lang.String strOldContents,
java.lang.String strNewContents)
Replaces contents from a given string.
|
patternedReplace
public static char capsLower(char cIn)
cIn
- - The incoming character.public static java.lang.String capsLower(java.lang.String strIn)
strIn
- - The incoming string.public static char capsReverse(char cIn)
cIn
- - The incoming character.public static java.lang.String capsReverse(java.lang.String strIn)
strIn
- - The incoming string.public static char capsUpper(char cIn)
cIn
- - The incoming character.public static java.lang.String capsUpper(java.lang.String strIn)
strIn
- - The incoming string.public static int compare(java.lang.String str1, java.lang.String str2)
str1
- - One string to compare.str2
- - Another string to compare.public static int compare(java.lang.String str1, java.lang.String str2, java.util.Locale locale)
str1
- - One string to compare.str2
- - Another string to compare.locale
- - Compare according to this locale.public static java.lang.String concat(java.lang.Object... o1dArgs)
o1dArgs
- - Incoming things, can be a bunch of true strings, or strings
from ".toString()", or the mixture of them.public static java.lang.String convert(java.lang.String strIn, java.lang.String strSourceEncoding, java.lang.String strTargetEncoding)
strIn
- - Incoming string to be converted.strSourceEncoding
- - Previous encoding of incoming string.strTargetEncoding
- - Demanded new encoding of incoming string.public static java.lang.String eatHeadSpaces(java.lang.String strIn)
strIn
- - The incoming string.public static java.lang.String eatTailSpaces(java.lang.String strIn)
strIn
- - The incoming string.public static java.lang.String format(java.lang.String strPattern, java.lang.Object[] o1dArgs)
strPattern
- - The incoming message pattern.o1dArgs
- - The arguments which will be filled into the blanks of the
main string.public static java.lang.String n2s(java.lang.String strIn)
strIn
- - The incoming string.public static java.lang.String s2n(java.lang.String strIn)
strIn
- - The incoming string.public static java.lang.String o2s(java.lang.Object oIn, java.lang.String strReplacement)
oIn
- - The incoming object to convert.strReplacement
- - Replacement, while the converting result is
null..public static boolean isInScopeIgnoreCase(java.lang.String strGiven, java.lang.String[] str1dScope)
MiscToolP.isInScope(Object, Object[])
if
the judgment is case sensitive.strGiven
- - The given value.str1dScope
- - The reference scope.public static boolean isInScopeIgnoreCase(java.lang.String strGiven, java.util.Collection<java.lang.String> colScope)
MiscToolP.isInScope(Object, Collection)
if
the judgment is case sensitive.strGiven
- - The given value.colScope
- - The reference scope.public static java.lang.String simpleReplace(java.lang.String strIn, java.lang.String strOldContents, java.lang.String strNewContents)
strIn
- - The incoming string.strOldContents
- - The old contents to be replaced.strNewContents
- - The new contents to replace the old.public static void simpleReplace(java.lang.StringBuffer sbIn, java.lang.String strOldContents, java.lang.String strNewContents)
sbIn
- - The incoming string buffer.strOldContents
- - The old contents to be replaced.strNewContents
- - The new contents to replace the old.public static void simpleReplace(java.lang.StringBuilder sbIn, java.lang.String strOldContents, java.lang.String strNewContents)
sbIn
- - The incoming string buffer.strOldContents
- - The old contents to be replaced.strNewContents
- - The new contents to replace the old.