| java.lang.Object org.sakaiproject.util.StringUtil
StringUtil | public class StringUtil (Code) | |
StringUtil collects together some string utility classes.
|
Method Summary | |
public static boolean | contains(Collection stringCollection, String value) | public static boolean | contains(String[] stringCollection, String value) | public static boolean | contains(String[] stringCollection, String value, boolean ignoreCase) Determine if a String is contained in a String [], ignoring case or not as specified
Parameters: stringCollection - The String[] to scan Parameters: value - The value to look for Parameters: ignoreCase - if true, we will do the compare case insensitive. | public static boolean | containsIgnoreCase(String target, String substring) Check if the target contains the substring anywhere, ignore case.
Parameters: target - The string to check. Parameters: substring - The value to check for. | public static boolean | containsIgnoreCase(Collection stringCollection, String value) | public static boolean | containsIgnoreCase(String[] stringCollection, String value) | public static boolean | different(String a, String b) Compare two strings for differences, either may be null
Parameters: a - One String. Parameters: b - The other String. | public static boolean | different(String a, String b, boolean ignoreCase) Compare two strings for differences, either may be null, ignore case if specified
Parameters: a - One String. Parameters: b - The other String. Parameters: ignoreCase - if true, we will do the compare case insensitive. | public static boolean | different(String[] a, String[] b) Compare two String[] for differences, either may be null
Parameters: a - One String[]. Parameters: b - The other String[]. | public static boolean | different(byte[] a, byte[] b) Compare two byte[] for differences, either may be null
Parameters: a - One byte[]. Parameters: b - The other byte[]. | public static String | fullReference(String root, String relative) Create a full reference from a relative reference merged with a root reference.
Parameters: root - The root reference, which is the root of the full reference. Parameters: relative - The relative reference, to add to the path of the root. | public static String | limit(String value, int length) Limit the string to a certain number of characters, adding "..." if it was truncated
Parameters: value - The string to limit. Parameters: length - the length to limit to (as an int). | public static String | referencePath(String ref) Compute the reference path (i.e. | public static String[] | split(String source, String splitter) Like jdk1.4's String.split... | public static String[] | splitFirst(String source, String splitter) Split the source into two strings at the first occurrence of the splitter Subsequent occurrences are not treated specially, and may be part of the second string.
Parameters: source - The string to split Parameters: splitter - The string that forms the boundary between the two strings returned. | public static String | trimToNull(String value) Trim blanks, and if nothing left, make null.
Parameters: value - The string to trim. | public static String | trimToNullLower(String value) Trim blanks, and if nothing left, make null, else lowercase.
Parameters: value - The string to trim. | public static String | trimToZero(String value) Trim blanks, and assure there is a value, and it's not null.
Parameters: value - The string to trim. | public static String | trimToZeroLower(String value) Trim blanks, and assure there is a value, and it's not null, then lowercase.
Parameters: value - The string to trim. | public static String | unsplit(String[] parts, String splitter) Reverse the split operation. | public static String | unsplit(String[] parts, int index, int length, String splitter) Reverse the split operation. |
contains | public static boolean contains(Collection stringCollection, String value)(Code) | | Determine if a String is contained in a String Collection
Parameters: stringCollection - The collection of (String) to scan Parameters: value - The value to look for true if the string was found |
contains | public static boolean contains(String[] stringCollection, String value)(Code) | | Determine if a String is contained in a String[]
Parameters: stringCollection - The String[] to scan Parameters: value - The value to look for true if the string was found |
contains | public static boolean contains(String[] stringCollection, String value, boolean ignoreCase)(Code) | | Determine if a String is contained in a String [], ignoring case or not as specified
Parameters: stringCollection - The String[] to scan Parameters: value - The value to look for Parameters: ignoreCase - if true, we will do the compare case insensitive. true if the string was found |
containsIgnoreCase | public static boolean containsIgnoreCase(String target, String substring)(Code) | | Check if the target contains the substring anywhere, ignore case.
Parameters: target - The string to check. Parameters: substring - The value to check for. true of the target contains the substring anywhere, ignore case, or false if it does not. |
containsIgnoreCase | public static boolean containsIgnoreCase(Collection stringCollection, String value)(Code) | | Determine if a String is contained in a String Collection, ignoring case
Parameters: stringCollection - The collection of (String) to scan Parameters: value - The value to look for true if the string was found |
containsIgnoreCase | public static boolean containsIgnoreCase(String[] stringCollection, String value)(Code) | | Determine if a String is contained in a String [], ignoring case
Parameters: stringCollection - The String[] to scan Parameters: value - The value to look for true if the string was found |
different | public static boolean different(String a, String b)(Code) | | Compare two strings for differences, either may be null
Parameters: a - One String. Parameters: b - The other String. true if the strings are different, false if they are the same. |
different | public static boolean different(String a, String b, boolean ignoreCase)(Code) | | Compare two strings for differences, either may be null, ignore case if specified
Parameters: a - One String. Parameters: b - The other String. Parameters: ignoreCase - if true, we will do the compare case insensitive. true if the strings are different, false if they are the same. |
different | public static boolean different(String[] a, String[] b)(Code) | | Compare two String[] for differences, either may be null
Parameters: a - One String[]. Parameters: b - The other String[]. true if the String[]s are different, false if they are the same. |
different | public static boolean different(byte[] a, byte[] b)(Code) | | Compare two byte[] for differences, either may be null
Parameters: a - One byte[]. Parameters: b - The other byte[]. true if the byte[]s are different, false if they are the same. |
fullReference | public static String fullReference(String root, String relative)(Code) | | Create a full reference from a relative reference merged with a root reference.
Parameters: root - The root reference, which is the root of the full reference. Parameters: relative - The relative reference, to add to the path of the root. A full reference from the root and relative references. |
limit | public static String limit(String value, int length)(Code) | | Limit the string to a certain number of characters, adding "..." if it was truncated
Parameters: value - The string to limit. Parameters: length - the length to limit to (as an int). The limited string. |
referencePath | public static String referencePath(String ref)(Code) | | Compute the reference path (i.e. the container) for a given reference.
Parameters: ref - The reference string. The reference root for the given reference. |
splitFirst | public static String[] splitFirst(String source, String splitter)(Code) | | Split the source into two strings at the first occurrence of the splitter Subsequent occurrences are not treated specially, and may be part of the second string.
Parameters: source - The string to split Parameters: splitter - The string that forms the boundary between the two strings returned. An array of two strings split from source by splitter. |
trimToNull | public static String trimToNull(String value)(Code) | | Trim blanks, and if nothing left, make null.
Parameters: value - The string to trim. value trimmed of blanks, and if nothing left, made null. |
trimToNullLower | public static String trimToNullLower(String value)(Code) | | Trim blanks, and if nothing left, make null, else lowercase.
Parameters: value - The string to trim. value trimmed of blanks, lower cased, and if nothing left, made null. |
trimToZero | public static String trimToZero(String value)(Code) | | Trim blanks, and assure there is a value, and it's not null.
Parameters: value - The string to trim. value trimmed of blanks, assuring it not to be null. |
trimToZeroLower | public static String trimToZeroLower(String value)(Code) | | Trim blanks, and assure there is a value, and it's not null, then lowercase.
Parameters: value - The string to trim. value trimmed of blanks, lower cased, assuring it not to be null. |
unsplit | public static String unsplit(String[] parts, String splitter)(Code) | | Reverse the split operation.
Parameters: parts - The parts to combine Parameters: splitter - The between-parts text |
unsplit | public static String unsplit(String[] parts, int index, int length, String splitter)(Code) | | Reverse the split operation.
Parameters: parts - The parts to combine Parameters: index - the index to the fist part to use Parameters: length - the number of parts to use Parameters: splitter - The between-parts text |
|
|