|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.thortech.xl.util.adapters.tcUtilStringOperations
public class tcUtilStringOperations
This class that has basic string operations utility methods. Author: Solomon Niyazov January 7, 2002.
Method Summary | |
---|---|
static boolean |
containsAlpha(java.lang.String value) Checks if the String contains any alphabets in a string |
static boolean |
containsAlphaNum(java.lang.String value) Checks if the String contains any alphabets/numbers in a string |
static boolean |
containsNumber(java.lang.String value) Checks if the string contains any number |
static java.lang.String |
convertToString(java.lang.Object poValue) method that returns String representation of Object. |
static java.lang.String |
getRandomString(int len) method that returns a random string of the specified length. |
static int |
getStringLength(java.lang.String psValue) method that returns length of the string passed it. |
static int |
getTrimmedStringLength(java.lang.String psValue) method that returns trimmed length of the string passed it. |
static int |
getUniqueCharactersCount(java.lang.String inputString) operation that does validation for unique characters count. |
static java.lang.String |
holdData(java.lang.String data) method that holds the value passed to it and returns it back This is usefull for entity adapters to map Xellerate data from User management form etc to process data. |
static java.lang.String |
insertWhiteSpace(java.lang.String psInput, int pnOffset, int pnNumSpaces) method that insert whitespace character(s) into the specified string |
static boolean |
isInputWithRepeatedConsecutiveCharacters(java.lang.String inputString) operation that does validation for repeatable consecutive characters. |
static boolean |
isInvalidCharacter(java.lang.String psValue, char charToCheck) method that checks if the character exist in the string. |
static void |
main(java.lang.String[] arg) Main Method |
static int |
numberOfAlphaInString(java.lang.String value) Numbers of alphabets in a string |
static int |
numberOfAlphaNumInString(java.lang.String value) this method returns the numbers of alphabets + number of numbers in a string |
static int |
numberOfNumbersInString(java.lang.String value) Returns the number of numbers in the string |
static int |
numberOfSpecialCharInString(java.lang.String value) returns the number of special characters in a string |
static java.lang.String |
performConcat(java.lang.String value1, java.lang.String value2) method that performs concatenation of two strings. |
static java.lang.String |
performConcatWithSpace(java.lang.String value1, java.lang.String value2) method that performs concatenation of two strings with a space in between |
static boolean |
performLowerCaseCheck(java.lang.String value) Returns true if there is atleast one lowercase |
static boolean |
performSpecialCharCheck(java.lang.String value) Checks if the string has any special character in it. |
static java.lang.String |
performSubstring(java.lang.String value, int beginPos) method that performs substring function based on specified begin position. |
static java.lang.String |
performSubstring(java.lang.String value, java.lang.Integer beginPos) method that performs substring function based on specified begin position. |
static java.lang.String |
performSubstring(java.lang.String value, java.lang.Integer beginPos, java.lang.Integer endPos) method that performs substring function based on specified begin and end positions. |
static java.lang.String |
performSubstring(java.lang.String value, int beginPos, int endPos) method that performs substring function based on specified begin and end positions. |
static java.lang.String |
performSubstringLess(java.lang.String value, java.lang.Integer beginPos, java.lang.Integer endPos) method that performs substring function based on specified begin and end positions. |
static java.lang.String |
performSubstringLess(java.lang.String value, int beginPos, int endPos) method that performs substring function based on specified begin and end positions. |
static java.lang.String |
performToLowerCase(java.lang.String value) method that converts string to Lower case. |
static java.lang.String |
performToUpperCase(java.lang.String value) method that converts string to Upper case. |
static java.lang.String |
replaceWithWhitespace(java.lang.String psInput, char pcOldChar) method that replaces the specified character of a string with a whitespace character. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getRandomString(int len)
len
- len.public static java.lang.String replaceWithWhitespace(java.lang.String psInput, char pcOldChar)
psInput
- string on which this operation is performed.pcOldChar
- character to be replaced by the whitespace character.public static java.lang.String insertWhiteSpace(java.lang.String psInput, int pnOffset, int pnNumSpaces)
psInput
- string on which this operation is performed.pnOffset
- beginning position of whitespace insertion.pnNumSpaces
- number of whitespace characters to be insertedpublic static java.lang.String holdData(java.lang.String data)
data
- data.public static java.lang.String performConcat(java.lang.String value1, java.lang.String value2)
value1
- value1.value2
- value2.public static java.lang.String performConcatWithSpace(java.lang.String value1, java.lang.String value2)
value1
- value1.value2
- value2.public static java.lang.String performSubstringLess(java.lang.String value, int beginPos, int endPos) throws java.lang.Exception
value
- String to be checked.beginPos
- begining Position.endPos
- end Position.java.lang.Exception
public static java.lang.String performSubstring(java.lang.String value, int beginPos, int endPos) throws java.lang.Exception
value
- String to be checkedbeginPos
- begining Position.endPos
- end Position.java.lang.Exception
public static java.lang.String performSubstring(java.lang.String value, int beginPos) throws java.lang.Exception
value
- String to be checkedbeginPos
- begining Position.java.lang.Exception
public static java.lang.String performSubstring(java.lang.String value, java.lang.Integer beginPos, java.lang.Integer endPos) throws java.lang.Exception
value
- String to be checkedbeginPos
- begining Position.endPos
- end Position.java.lang.Exception
public static java.lang.String performSubstringLess(java.lang.String value, java.lang.Integer beginPos, java.lang.Integer endPos) throws java.lang.Exception
value
- String to be checkedbeginPos
- begining Position.endPos
- end Position.java.lang.Exception
public static java.lang.String performSubstring(java.lang.String value, java.lang.Integer beginPos) throws java.lang.Exception
value
- String to be checkedbeginPos
- begining Position.java.lang.Exception
public static java.lang.String performToUpperCase(java.lang.String value)
value
- value.public static java.lang.String performToLowerCase(java.lang.String value)
value
- String to be checkedpublic static int numberOfNumbersInString(java.lang.String value)
value
- String to be checkedpublic static boolean containsNumber(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static int numberOfAlphaInString(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static boolean containsAlpha(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static boolean containsAlphaNum(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static int numberOfAlphaNumInString(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static boolean performSpecialCharCheck(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static int numberOfSpecialCharInString(java.lang.String value) throws java.lang.Exception
value
- String to be checkedjava.lang.Exception
public static boolean performLowerCaseCheck(java.lang.String value) throws java.lang.Exception
string
- to be checkedjava.lang.Exception
public static int getStringLength(java.lang.String psValue)
psValue
- String .public static int getTrimmedStringLength(java.lang.String psValue)
psValue
- Value to be trimmed .public static java.lang.String convertToString(java.lang.Object poValue)
poValue
- Object to be converted to the String .public static boolean isInvalidCharacter(java.lang.String psValue, char charToCheck)
psValue
- psValue string to check.charToCheck
-public static boolean isInputWithRepeatedConsecutiveCharacters(java.lang.String inputString)
inputString
- inputString string to be tested.public static int getUniqueCharactersCount(java.lang.String inputString)
inputString
- inputString string to be tested.public static void main(java.lang.String[] arg)
arg
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |