com.generationjava.lang
Class StringW

java.lang.Object
  extended by com.generationjava.lang.StringW

public final class StringW
extends java.lang.Object

A set of String library static methods. While extending String or StringBuffer would have been the nicest solution, that is not possible, so a simple set of static methods seems the most workable. Method ideas have so far been taken from the PHP4, Ruby and .NET languages.


Field Summary
static java.lang.String LINE_SEPARATOR
           
 
Constructor Summary
StringW()
           
 
Method Summary
static java.lang.String capitalise(java.lang.String str)
          Capitalise a string.
static java.lang.String capitaliseAllWords(java.lang.String str)
          Capitalise all the words in a string.
static java.lang.String center(java.lang.String str, int n)
          Center a string in a larger string of size n.
static java.lang.String center(java.lang.String str, int n, java.lang.String delim)
          Center a string in a larger string of size n.
static java.lang.String center(java.lang.String str, java.lang.String n, java.lang.String delim)
           
static java.lang.String chomp(java.lang.String str)
          Remove the last newline, and everything after it from a String.
static java.lang.String chomp(java.lang.String str, java.lang.String sep)
          Remove the last value of a supplied String, and everything after it from a String.
static java.lang.String chompLast(java.lang.String str)
          Remove a newline if and only if it is at the end of the supplied string.
static java.lang.String chompLast(java.lang.String str, java.lang.String sep)
           
static java.lang.String chop(java.lang.String str)
          Remove the last character from a String.
static java.lang.String chopNewline(java.lang.String str)
          Remove \n from end of a String if it's there.
static int count(java.lang.String str, java.lang.String set)
           
static int count(java.lang.String str, java.lang.String[] set)
          Takes an argument in set-syntax, see evaluateSet, and returns the number of characters present in the specified string.
static int countMatches(java.lang.String str, java.lang.String sub)
          How mmany times is the substring in the larger string.
static java.lang.String defaultString(java.lang.String str)
          Return either the passed in String, or if it is null, then an empty String.
static java.lang.String defaultString(java.lang.String str, java.lang.String def)
          Return either the passed in String, or if it is null, then a passed in default String.
static java.lang.String delete(java.lang.String str, java.lang.String set)
           
static java.lang.String delete(java.lang.String str, java.lang.String[] set)
          Takes an argument in set-syntax, see evaluateSet, and deletes any of characters present in the specified string.
static java.lang.String escape(java.lang.String str)
          Escapes any values it finds into their String form.
static CharSet evaluateSet(java.lang.String[] set)
          Creates a CharSet object which allows a certain amount of set logic to be performed upon the following syntax: "aeio" which implies 'a','e',..
static java.lang.String[] explode(java.lang.String str)
          Turn a space-separated string into an array of Strings.
static java.lang.String[] explode(java.lang.String str, java.lang.String sep)
          Turn a separated string into an array of Strings.
static java.lang.String[] explode(java.lang.String str, java.lang.String sep, int n)
          Turn a separated string into an array of Strings.
static java.lang.String[] explode(java.lang.String str, java.lang.String sep, java.lang.String n)
           
static java.lang.String getChomp(java.lang.String str, java.lang.String sep)
          Remove everything and return the last value of a supplied String, and everything after it from a String.
static int getLevenshteinDistance(java.lang.String s, java.lang.String t)
          Find the Levenshtein distance between two strings.
static java.lang.String getNestedString(java.lang.String str, java.lang.String tag)
          Get the String that is nested in between two instances of the same String.
static java.lang.String getNestedString(java.lang.String str, java.lang.String open, java.lang.String close)
          Get the string that is nested in between two strings.
static java.lang.String getPrechomp(java.lang.String str, java.lang.String sep)
          Remove and return everything before the first value of a supplied String from another String.
static java.lang.String implode(java.util.Enumeration enume, java.lang.String sep)
           
static java.lang.String implode(java.util.Iterator iterator, java.lang.String sep)
          Merge an Iterator of Objects into a list of delimited Strings.
static java.lang.String implode(java.lang.Object[] objs, java.lang.String sep)
          Merge an array of Objects into a list of delimited Strings.
static java.lang.String implode(java.lang.Object[] objs, java.lang.String sep, java.lang.String pre, java.lang.String post)
           
static int indexOfAny(java.lang.String str, java.lang.String[] strs)
          Find the earlier index of any of a set of potential substrings.
static java.lang.String interpolate(java.lang.String text, java.util.Map map)
          Interpolate variables into a String.
static boolean isAlphanumeric(java.lang.String str)
          Does a String contain only unicode letters or digits.
static boolean isLine(java.lang.String str)
          Is a String a line, containing only letters, digits or whitespace, and ending with an optional newline.
static boolean isMetaphoneEqual(java.lang.String str1, java.lang.String str2)
          Are the metaphones of two strings the same.
static boolean isNumeric(java.lang.String str)
          Does a String contain only unicode digits.
static boolean isWord(java.lang.String str)
          Is a String a word.
static int lastIndexOfAny(java.lang.String str, java.lang.String[] strs)
          Find the latest index of any of a set of potential substrings.
static java.lang.String leftPad(java.lang.String str, int n)
          Left pad a String with spaces.
static java.lang.String leftPad(java.lang.String str, int n, java.lang.String delim)
          Left pad a String with a specified string.
static java.lang.String leftPad(java.lang.String str, java.lang.String n, java.lang.String delim)
           
static java.lang.String lowerCase(java.lang.String str)
           
static java.lang.String metaphone(java.lang.String str)
          Find the metaphone value of a String.
static java.lang.String overlayString(java.lang.String text, java.lang.String overlay, int start, int end)
          Overlay a part of a string with another string.
static java.lang.String overlayString(java.lang.String text, java.lang.String overlay, java.lang.String start, java.lang.String end)
           
static java.lang.String prechomp(java.lang.String str, java.lang.String sep)
          Remove the first value of a supplied String, and everything before it from a String.
static java.lang.String quoteRegularExpression(java.lang.String str)
          Quote a string so that it may be used in a regular expression without any parts of the string being considered as a part of the regular expression's control characters.
static java.lang.String random(int count)
           
static java.lang.String random(int count, boolean letters, boolean numbers)
           
static java.lang.String random(int count, char[] set)
           
static java.lang.String random(int count, int start, int end, boolean letters, boolean numbers)
           
static java.lang.String random(int count, int start, int end, boolean letters, boolean numbers, char[] set)
          Create a random string based on a variety of options.
static java.lang.String random(int count, java.lang.String set)
           
static java.lang.String randomAlphabetic(int count)
           
static java.lang.String randomAlphanumeric(int count)
           
static java.lang.String randomAscii(int count)
           
static java.lang.String randomNumeric(int count)
           
static java.lang.String repeat(java.lang.String str, int n)
          Repeat a string n times to form a new string.
static java.lang.String repeat(java.lang.String str, java.lang.String n)
           
static java.lang.String replaceString(java.lang.String text, java.lang.String repl, java.lang.String with)
          Replace a string with another string inside a larger string, for all of the search string.
static java.lang.String replaceString(java.lang.String text, java.lang.String repl, java.lang.String with, int max)
          Replace a string with another string inside a larger string, for the first n values of the search string.
static java.lang.String replaceString(java.lang.String text, java.lang.String repl, java.lang.String with, java.lang.String n)
           
static java.lang.String replaceStringOnce(java.lang.String text, java.lang.String repl, java.lang.String with)
          Replace a string with another string inside a larger string, once.
static java.lang.String reverse(java.lang.String str)
          Reverse a String.
static java.lang.String reverseDelimitedString(java.lang.String text, java.lang.String delimiter)
           
static java.lang.String reverseDottedName(java.lang.String text)
           
static java.lang.String rightPad(java.lang.String str, int n)
          Right pad a String with spaces.
static java.lang.String rightPad(java.lang.String str, int n, java.lang.String delim)
          Right pad a String with a specified string.
static java.lang.String rightPad(java.lang.String str, java.lang.String n, java.lang.String delim)
           
static java.lang.String soundex(java.lang.String str)
          Get the SoundEx value of a string.
static java.lang.String squeeze(java.lang.String str, java.lang.String set)
           
static java.lang.String squeeze(java.lang.String str, java.lang.String[] set)
          Squeezes any repititions of a character that is mentioned in the supplied set.
static java.lang.String strip(java.lang.String str)
          Remove whitespace from the front and back of a String.
static java.lang.String strip(java.lang.String str, java.lang.String delim)
          Remove a specified String from the front and back of a String.
static java.lang.String stripEnd(java.lang.String str, java.lang.String ch)
          Strip any of a supplied substring from the end of a String..
static java.lang.String stripStart(java.lang.String str, java.lang.String ch)
          Strip any of a supplied substring from the start of a String..
static java.lang.String substring(java.lang.String str, int start)
           
static java.lang.String substring(java.lang.String str, int start, int end)
           
static java.lang.String substring(java.lang.String str, java.lang.String start)
           
static java.lang.String substring(java.lang.String str, java.lang.String start, java.lang.String end)
           
static java.lang.String swapCase(java.lang.String str)
          Swaps the case of String.
static java.lang.String translate(java.lang.String target, java.lang.String repl, java.lang.String with)
          Translate characters in a String.
static java.lang.String trim(java.lang.String str)
           
static java.lang.String uncapitalise(java.lang.String str)
          Uncapitalise a string.
static java.lang.String upperCase(java.lang.String str)
           
static java.lang.String wordWrap(java.lang.String str)
          Create a word-wrapped version of a String.
static java.lang.String wordWrap(java.lang.String str, int width)
          Create a word-wrapped version of a String.
static java.lang.String wordWrap(java.lang.String str, int width, java.lang.String delim, java.lang.String split)
          Word-wrap a string.
static java.lang.String wordWrap(java.lang.String str, java.lang.String width, java.lang.String delim, java.lang.String split)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static java.lang.String LINE_SEPARATOR
Constructor Detail

StringW

public StringW()
Method Detail

implode

public static java.lang.String implode(java.lang.Object[] objs,
                                       java.lang.String sep,
                                       java.lang.String pre,
                                       java.lang.String post)

implode

public static java.lang.String implode(java.lang.Object[] objs,
                                       java.lang.String sep)
Merge an array of Objects into a list of delimited Strings. No delimiter is added before or after the list.

Parameters:
objs - Object[] to put into String list form
sep - String delimiter
Returns:
String delimited list of the passed in object's toStrings.

implode

public static java.lang.String implode(java.util.Iterator iterator,
                                       java.lang.String sep)
Merge an Iterator of Objects into a list of delimited Strings. No delimiter is added before or after the list.

Parameters:
objs - Object[] to put into String list form
sep - String delimiter
Returns:
String delimited list of the passed in object's toStrings.

implode

public static java.lang.String implode(java.util.Enumeration enume,
                                       java.lang.String sep)

explode

public static java.lang.String[] explode(java.lang.String str)
Turn a space-separated string into an array of Strings.

Parameters:
str - String to separate
Returns:
String[] of separated Strings

explode

public static java.lang.String[] explode(java.lang.String str,
                                         java.lang.String sep)
Turn a separated string into an array of Strings.

Parameters:
str - String to separate
sep - String separator
Returns:
String[] of separated Strings

explode

public static java.lang.String[] explode(java.lang.String str,
                                         java.lang.String sep,
                                         java.lang.String n)

explode

public static java.lang.String[] explode(java.lang.String str,
                                         java.lang.String sep,
                                         int n)
Turn a separated string into an array of Strings. A maximum length for the returned array may be passed in. A max length of -1 implies that there need be no limit.

Parameters:
str - String to separate
sep - String separator
n - int max length of the array
Returns:
String[] of separated Strings

uncapitalise

public static java.lang.String uncapitalise(java.lang.String str)
Uncapitalise a string. That is, convert the first character into lower-case.

Parameters:
str - String to uncapitalise
Returns:
String uncapitalised

capitalise

public static java.lang.String capitalise(java.lang.String str)
Capitalise a string. That is, convert the first character into title-case.

Parameters:
str - String to capitalise
Returns:
String capitalised

replaceStringOnce

public static java.lang.String replaceStringOnce(java.lang.String text,
                                                 java.lang.String repl,
                                                 java.lang.String with)
Replace a string with another string inside a larger string, once.

Parameters:
text - String to do search and replace in
repl - String to search for
with - String to replace with
Returns:
String with once value replaced

replaceString

public static java.lang.String replaceString(java.lang.String text,
                                             java.lang.String repl,
                                             java.lang.String with)
Replace a string with another string inside a larger string, for all of the search string.

Parameters:
text - String to do search and replace in
repl - String to search for
with - String to replace with
Returns:
String with all values replaced

replaceString

public static java.lang.String replaceString(java.lang.String text,
                                             java.lang.String repl,
                                             java.lang.String with,
                                             java.lang.String n)

replaceString

public static java.lang.String replaceString(java.lang.String text,
                                             java.lang.String repl,
                                             java.lang.String with,
                                             int max)
Replace a string with another string inside a larger string, for the first n values of the search string.

Parameters:
text - String to do search and replace in
repl - String to search for
with - String to replace with
n - int values to replace
Returns:
String with n values replacEd

overlayString

public static java.lang.String overlayString(java.lang.String text,
                                             java.lang.String overlay,
                                             java.lang.String start,
                                             java.lang.String end)

overlayString

public static java.lang.String overlayString(java.lang.String text,
                                             java.lang.String overlay,
                                             int start,
                                             int end)
Overlay a part of a string with another string.

Parameters:
text - String to do overlaying in
overlay - String to overlay
start - int to start overlaying at
end - int to stop overlaying before
Returns:
String with overlayed text

repeat

public static java.lang.String repeat(java.lang.String str,
                                      java.lang.String n)

repeat

public static java.lang.String repeat(java.lang.String str,
                                      int n)
Repeat a string n times to form a new string.

Parameters:
str - String to repeat
n - int number of times to repeat
Returns:
String with repeated string

center

public static java.lang.String center(java.lang.String str,
                                      int n)
Center a string in a larger string of size n. Uses spaces as the value to buffer the string with..

Parameters:
str - String to center
n - int size of new String
Returns:
String containing centered String

center

public static java.lang.String center(java.lang.String str,
                                      java.lang.String n,
                                      java.lang.String delim)

center

public static java.lang.String center(java.lang.String str,
                                      int n,
                                      java.lang.String delim)
Center a string in a larger string of size n. Uses a supplied String as the value to buffer the string with..

Parameters:
str - String to center
n - int size of new String
delim - String to buffer the new String with
Returns:
String containing centered String

chomp

public static java.lang.String chomp(java.lang.String str)
Remove the last newline, and everything after it from a String.

Parameters:
str - String to chomp the newline from
Returns:
String without chomped newline

chomp

public static java.lang.String chomp(java.lang.String str,
                                     java.lang.String sep)
Remove the last value of a supplied String, and everything after it from a String.

Parameters:
str - String to chomp from
sep - String to chomp
Returns:
String without chomped ending

chompLast

public static java.lang.String chompLast(java.lang.String str)
Remove a newline if and only if it is at the end of the supplied string.


chompLast

public static java.lang.String chompLast(java.lang.String str,
                                         java.lang.String sep)

getChomp

public static java.lang.String getChomp(java.lang.String str,
                                        java.lang.String sep)
Remove everything and return the last value of a supplied String, and everything after it from a String.

Parameters:
str - String to chomp from
sep - String to chomp
Returns:
String chomped

prechomp

public static java.lang.String prechomp(java.lang.String str,
                                        java.lang.String sep)
Remove the first value of a supplied String, and everything before it from a String.

Parameters:
str - String to chomp from
sep - String to chomp
Returns:
String without chomped beginning

getPrechomp

public static java.lang.String getPrechomp(java.lang.String str,
                                           java.lang.String sep)
Remove and return everything before the first value of a supplied String from another String.

Parameters:
str - String to chomp from
sep - String to chomp
Returns:
String prechomped

chop

public static java.lang.String chop(java.lang.String str)
Remove the last character from a String. If the String ends in \r\n, then remove both of them.

Parameters:
str - String to chop last character from
Returns:
String without last character

chopNewline

public static java.lang.String chopNewline(java.lang.String str)
Remove \n from end of a String if it's there. If a \r precedes it, then remove that too.

Parameters:
str - String to chop a newline from
String - without newline on end

evaluateSet

public static CharSet evaluateSet(java.lang.String[] set)
Creates a CharSet object which allows a certain amount of set logic to be performed upon the following syntax: "aeio" which implies 'a','e',.. "^e" implies not e. However it only negates, it's not a set in itself due to the size of that set in unicode. "ej-m" implies j->m. j,k,l,m.


count

public static int count(java.lang.String str,
                        java.lang.String set)

count

public static int count(java.lang.String str,
                        java.lang.String[] set)
Takes an argument in set-syntax, see evaluateSet, and returns the number of characters present in the specified string. An example would be: count("hello", {"c-f","o"}) returns 2.

Parameters:
str - String target to count characters in
str - String[] set of characters to count

delete

public static java.lang.String delete(java.lang.String str,
                                      java.lang.String set)

delete

public static java.lang.String delete(java.lang.String str,
                                      java.lang.String[] set)
Takes an argument in set-syntax, see evaluateSet, and deletes any of characters present in the specified string. An example would be: delete("hello", {"c-f","o"}) returns "hll"

Parameters:
str - String target to delete characters from
str - String[] set of characters to delete

squeeze

public static java.lang.String squeeze(java.lang.String str,
                                       java.lang.String set)

squeeze

public static java.lang.String squeeze(java.lang.String str,
                                       java.lang.String[] set)
Squeezes any repititions of a character that is mentioned in the supplied set. An example is: squeeze("hello", {"el"}) => "helo" See evaluateSet for set-syntax.


translate

public static java.lang.String translate(java.lang.String target,
                                         java.lang.String repl,
                                         java.lang.String with)
Translate characters in a String. An example is: translate("hello", "ho", "jy") => jelly If the length of characters to search for is greater than the length of characters to replace, then the last character is used.

Parameters:
target - String to replace characters in
repl - String to find that will be replaced
with - String to put into the target String

escape

public static java.lang.String escape(java.lang.String str)
Escapes any values it finds into their String form. So a tab becomes the characters '\\' and 't'.

Parameters:
str - String to escape values in
Returns:
String with escaped values

rightPad

public static java.lang.String rightPad(java.lang.String str,
                                        int n)
Right pad a String with spaces. Pad to a size of n.


rightPad

public static java.lang.String rightPad(java.lang.String str,
                                        java.lang.String n,
                                        java.lang.String delim)

rightPad

public static java.lang.String rightPad(java.lang.String str,
                                        int n,
                                        java.lang.String delim)
Right pad a String with a specified string. Pad to a size of n.

Parameters:
str - String to pad out
n - int size to pad to
delim - String to pad with

leftPad

public static java.lang.String leftPad(java.lang.String str,
                                       int n)
Left pad a String with spaces. Pad to a size of n.


leftPad

public static java.lang.String leftPad(java.lang.String str,
                                       java.lang.String n,
                                       java.lang.String delim)

leftPad

public static java.lang.String leftPad(java.lang.String str,
                                       int n,
                                       java.lang.String delim)
Left pad a String with a specified string. Pad to a size of n.

Parameters:
str - String to pad out
n - int size to pad to
delim - String to pad with

reverse

public static java.lang.String reverse(java.lang.String str)
Reverse a String.


strip

public static java.lang.String strip(java.lang.String str)
Remove whitespace from the front and back of a String.


strip

public static java.lang.String strip(java.lang.String str,
                                     java.lang.String delim)
Remove a specified String from the front and back of a String. If Whitespace is wanted to be removed, used the strip(String) method.


swapCase

public static java.lang.String swapCase(java.lang.String str)
Swaps the case of String. Properly looks after making sure the start of words are Titlecase and not Uppercase.


indexOfAny

public static int indexOfAny(java.lang.String str,
                             java.lang.String[] strs)
Find the earlier index of any of a set of potential substrings.


lastIndexOfAny

public static int lastIndexOfAny(java.lang.String str,
                                 java.lang.String[] strs)
Find the latest index of any of a set of potential substrings.


stripEnd

public static java.lang.String stripEnd(java.lang.String str,
                                        java.lang.String ch)
Strip any of a supplied substring from the end of a String..


stripStart

public static java.lang.String stripStart(java.lang.String str,
                                          java.lang.String ch)
Strip any of a supplied substring from the start of a String..


getLevenshteinDistance

public static int getLevenshteinDistance(java.lang.String s,
                                         java.lang.String t)
Find the Levenshtein distance between two strings. This is the number of changes needed to change one string into another. Where each change is a single character modification. This implemmentation of the levenshtein distance algorithm is from http://www.merriampark.com/ld.htm


soundex

public static java.lang.String soundex(java.lang.String str)
Get the SoundEx value of a string. This implementation is taken from the code-snippers on http://www.sourceforge.net/


metaphone

public static java.lang.String metaphone(java.lang.String str)
Find the metaphone value of a String. This is similar to the soundex algorithm, but better at finding similar sounding words.


isMetaphoneEqual

public static boolean isMetaphoneEqual(java.lang.String str1,
                                       java.lang.String str2)
Are the metaphones of two strings the same.


quoteRegularExpression

public static java.lang.String quoteRegularExpression(java.lang.String str)
Quote a string so that it may be used in a regular expression without any parts of the string being considered as a part of the regular expression's control characters.


capitaliseAllWords

public static java.lang.String capitaliseAllWords(java.lang.String str)
Capitalise all the words in a string. Uses Character.isWhitespace as a separator between words.


wordWrap

public static java.lang.String wordWrap(java.lang.String str)
Create a word-wrapped version of a String. Wrap at 80 characters and use newlines as the delimiter. If a word is over 80 characters long use a - sign to split it.


wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int width)
Create a word-wrapped version of a String. Wrap at a specified width and use newlines as the delimiter. If a word is over the width in lenght use a - sign to split it.


wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        java.lang.String width,
                                        java.lang.String delim,
                                        java.lang.String split)

wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int width,
                                        java.lang.String delim,
                                        java.lang.String split)
Word-wrap a string.

Parameters:
str - String to word-wrap
width - int to wrap at
delim - String to use to separate lines
split - String to use to split a word greater than width long
Returns:
String that has been word wrapped

getNestedString

public static java.lang.String getNestedString(java.lang.String str,
                                               java.lang.String tag)
Get the String that is nested in between two instances of the same String.

Parameters:
str - String containing nested-string
tag - String before and after nested-string
Returns:
String that was nested

getNestedString

public static java.lang.String getNestedString(java.lang.String str,
                                               java.lang.String open,
                                               java.lang.String close)
Get the string that is nested in between two strings.

Parameters:
str - String containing nested-string
open - String before nested-string
close - String after nested-string
Returns:
String that was nested

countMatches

public static int countMatches(java.lang.String str,
                               java.lang.String sub)
How mmany times is the substring in the larger string.


isWord

public static boolean isWord(java.lang.String str)
Is a String a word. Contains only unicode letters.


isAlphanumeric

public static boolean isAlphanumeric(java.lang.String str)
Does a String contain only unicode letters or digits.


isNumeric

public static boolean isNumeric(java.lang.String str)
Does a String contain only unicode digits.


isLine

public static boolean isLine(java.lang.String str)
Is a String a line, containing only letters, digits or whitespace, and ending with an optional newline. NB: Punctuation not allowed.


defaultString

public static java.lang.String defaultString(java.lang.String str)
Return either the passed in String, or if it is null, then an empty String.


defaultString

public static java.lang.String defaultString(java.lang.String str,
                                             java.lang.String def)
Return either the passed in String, or if it is null, then a passed in default String.


upperCase

public static java.lang.String upperCase(java.lang.String str)

lowerCase

public static java.lang.String lowerCase(java.lang.String str)

trim

public static java.lang.String trim(java.lang.String str)

substring

public static java.lang.String substring(java.lang.String str,
                                         java.lang.String start)

substring

public static java.lang.String substring(java.lang.String str,
                                         int start)

substring

public static java.lang.String substring(java.lang.String str,
                                         java.lang.String start,
                                         java.lang.String end)

substring

public static java.lang.String substring(java.lang.String str,
                                         int start,
                                         int end)

random

public static java.lang.String random(int count)

randomAscii

public static java.lang.String randomAscii(int count)

randomAlphabetic

public static java.lang.String randomAlphabetic(int count)

randomAlphanumeric

public static java.lang.String randomAlphanumeric(int count)

randomNumeric

public static java.lang.String randomNumeric(int count)

random

public static java.lang.String random(int count,
                                      boolean letters,
                                      boolean numbers)

random

public static java.lang.String random(int count,
                                      int start,
                                      int end,
                                      boolean letters,
                                      boolean numbers)

random

public static java.lang.String random(int count,
                                      int start,
                                      int end,
                                      boolean letters,
                                      boolean numbers,
                                      char[] set)
Create a random string based on a variety of options.

Parameters:
count - int length of random string to create
start - int position in set of chars to start at
end - int position in set of chars to end before
letters - boolean only allow letters?
numbers - boolean only allow numbers?
set - char[] set of chars to choose randoms from. If null, then it will use the set of all chars.

random

public static java.lang.String random(int count,
                                      java.lang.String set)

random

public static java.lang.String random(int count,
                                      char[] set)

reverseDottedName

public static java.lang.String reverseDottedName(java.lang.String text)

reverseDelimitedString

public static java.lang.String reverseDelimitedString(java.lang.String text,
                                                      java.lang.String delimiter)

interpolate

public static java.lang.String interpolate(java.lang.String text,
                                           java.util.Map map)
Interpolate variables into a String.