public class StringUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
StringUtilities.LevenstheinDistance
The class that describes the levensthein distance.
|
Constructor and Description |
---|
StringUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
concatenate(java.util.Collection s,
java.lang.String sep,
boolean trim)
This method takes a vector containing strings and return a single string.
|
static java.lang.String |
concatenate(java.lang.String[] s,
java.lang.String sep,
boolean trim)
This method takes a string array and return a single string.
|
static int |
levensthein(java.lang.String s1,
java.lang.String s2)
Calculate the levensthein distance of the strings.
|
static StringUtilities.LevenstheinDistance[] |
levenstheinDist(java.lang.String s,
java.lang.String[] arr)
Determine the levensthein distance of the given string belongs to all entries of the given array.
|
static StringUtilities.LevenstheinDistance[] |
levenstheinDistToIgnoreCase(java.lang.String s,
java.lang.String[] arr)
Determine the levensthein distance of the given string belongs to all entries of the given array.
|
static java.lang.String |
levenstheinFind(java.lang.String s,
java.lang.String[] arr)
Find the string in array by using the the levensthein distance of the strings.
|
static java.lang.String |
levenstheinFindToIgnoreCase(java.lang.String s,
java.lang.String[] arr)
Find the string in array by using the the levensthein distance of the strings.
|
static int |
levenstheinToIgnoreCase(java.lang.String s1,
java.lang.String s2)
Calculate the levensthein distance of the strings ignoring upper and lower case letters.
|
static void |
main(java.lang.String[] args)
The test programm.
|
static java.lang.String[] |
split(java.lang.String s,
int sep,
boolean trim)
This method takes a single string and return a string array.
|
static java.lang.String[] |
split(java.lang.String s,
java.lang.String sep,
boolean trim)
This method takes a single string and return a string array.
|
static java.lang.String |
substring(java.lang.String s,
char sep,
int number)
Substring number.
|
static java.lang.String |
substring(java.lang.String s,
char sep,
int number,
boolean trim)
Substring number.
|
static java.lang.String |
substring(java.lang.String s,
java.lang.String sep,
int number)
Substring number.
|
static java.lang.String |
substring(java.lang.String s,
java.lang.String sep,
int number,
boolean trim)
This method returns a part of a string.
|
static java.util.Properties |
toProperties(java.lang.String theString,
java.util.Properties props)
This method converts a string of the form
key=value [, anotherkey=anotherValue] into
properties.
|
static java.util.Vector |
vectorSplit(java.lang.String s,
int sep,
boolean trim)
This method takes a single string and return a string vector.
|
static java.util.Vector |
vectorSplit(java.lang.String s,
java.lang.String sep,
boolean trim)
This method takes a single string and return a vector containing the seperated strings..
|
public static java.util.Properties toProperties(java.lang.String theString, java.util.Properties props)
theString
- The string to be converted to properties.public static java.lang.String[] split(java.lang.String s, int sep, boolean trim)
s
- The string to be split.sep
- The separator character.trim
- If true The array elements will be trimmed.public static java.lang.String[] split(java.lang.String s, java.lang.String sep, boolean trim)
s
- The string to be split.sep
- The separator string.trim
- If true The array elements will be trimmed.public static java.util.Vector vectorSplit(java.lang.String s, java.lang.String sep, boolean trim)
s
- The string to be split.sep
- The separator string.trim
- If true The array elements will be trimmed.public static java.lang.String substring(java.lang.String s, java.lang.String sep, int number, boolean trim)
s
- the source stringsep
- The separator.number
- the number of the separator.trim
- if true true the result will be trimmed.public static java.lang.String substring(java.lang.String s, char sep, int number, boolean trim)
s
- the source stringsep
- The separator.number
- the number of the separator.trim
- if true true the result will be trimmed.substring(String, String, int, boolean)
public static java.lang.String substring(java.lang.String s, char sep, int number)
s
- the source stringsep
- The separator.number
- the number of the separator.substring(String, String, int, boolean)
public static java.lang.String substring(java.lang.String s, java.lang.String sep, int number)
s
- the source stringsep
- The separator.number
- the number of the separator.substring(String, String, int, boolean)
public static java.util.Vector vectorSplit(java.lang.String s, int sep, boolean trim)
s
- The string to be split.sep
- The separator character.trim
- If true The array elements will be trimmed.public static java.lang.String concatenate(java.util.Collection s, java.lang.String sep, boolean trim)
s
- The vector conatining strings.sep
- The separator string.
Could be null.trim
- If true The array elements will be trimmed.public static java.lang.String concatenate(java.lang.String[] s, java.lang.String sep, boolean trim)
s
- The string array to be concatenated.sep
- The separator string.
Could be null.trim
- If true The array elements will be trimmed.public static StringUtilities.LevenstheinDistance[] levenstheinDistToIgnoreCase(java.lang.String s, java.lang.String[] arr)
s
- string to find.arr
- array of strings.public static StringUtilities.LevenstheinDistance[] levenstheinDist(java.lang.String s, java.lang.String[] arr)
s
- string to find.arr
- array of strings.public static java.lang.String levenstheinFindToIgnoreCase(java.lang.String s, java.lang.String[] arr)
s
- string to find.arr
- array of strings.public static java.lang.String levenstheinFind(java.lang.String s, java.lang.String[] arr)
s
- string to find.arr
- array of strings.public static int levenstheinToIgnoreCase(java.lang.String s1, java.lang.String s2)
s1
- s2
- public static int levensthein(java.lang.String s1, java.lang.String s2)
s1
- s2
- public static void main(java.lang.String[] args)