This class add a case insensitive get to a List of Pairs of String, as if it was a Map
Add utility methods to Lists
Test for null and return either the given String if not null or the blank String.
Test for null and return either the given String if not null or the blank String.
Turns a string of format "foo_bar" into camel case "FooBar"
Turns a string of format "foo_bar" into camel case "FooBar"
Functional code courtesy of Jamie Webb ([email protected]) 2006/11/28
the String to CamelCase
the CamelCased string
Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.
Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.
the String to CamelCase
the CamelCased string
Capitalize every "word" in the string.
Capitalize every "word" in the string. A word is either separated by spaces or underscores.
string to capify
the capified string
Faster than roboSplit.
Faster than roboSplit... this method splits Strings at a given character
Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'
Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'
the cleaned string and an empty string if the input is null
Add commas before the last 3 characters
Add commas before the last 3 characters
the string with commas
Compute the deltas between two sequences of a given type.
Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned. The algorithm used to calculate the diffs is not very efficient and can degrade to O(n^2), so it's not great for large collections. Internally the Seq[T] are converted to a List[T]. Finally, it's highly recommended that T be immutable and does proper equals testing (e.g., a case class).
Compute the deltas between two sequences of a given type.
Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned.
Turn a String into a Box[String], with Empty for the blank string.
Turn a String into a Box[String], with Empty for the blank string.
A string containing only spaces is considered blank.
Full(s.trim) if s is not null or blank, Empty otherwise
Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value
Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value
the encoded string inserted into quotes
Convert a java.
Convert a java.util.Enumeration to a List[T]
Convert a java.
Convert a java.util.Enumeration to a List[String] using the toString method on each element
Create the unicode value of a character
Create the unicode value of a character
character
the unicode value as a string starting by \\u
Returns the first application of f to an element of in that results in a Full Box.
Returns the first application of f to an element of in that results in a Full Box. If f applied to an element of in results in an Empty Box, then f will be applied to the rest of the elements of in until a Full Box results. If the list runs out then an Empty Box is returned.
a list of elements to which f can be applied
a Box containing the first Full Box or Empty if f never returns a Full Box
Returns a Full Box with the first element x of the list in for which f(x) evaluates to true.
Returns a Full Box with the first element x of the list in for which f(x) evaluates to true. If f(x) evaluates to false for every x, then an Empty Box is returned.
a list of elements to which f can be applied
a function that can be applied to elements of in
a Box containing the found element (or Empty if not found)
Return the first element of a List or a default value if the list is empty
Return the first element of a List or a default value if the list is empty
Creates a List of Strings from a List[String] and a String
Creates a List of Strings from a List[String] and a String
Creates a List of Strings from two Strings
Creates a List of Strings from two Strings
Return a list containing the element f if the expression is true
Return a list containing the element f if the expression is true
a SuperString with more available methods such as roboSplit or commafy
adds the ciGet method to a List of Pairs of Strings
adds the ciGet method to a List of Pairs of Strings
an Empty can if the node seq is empty and a full can with the NodeSeq text otherwise
Parse a string and return the Long value of that string.
Parse a string and return the Long value of that string.
The string can start with '-' if it is a negative number or '+' for a positive number
the Long value of the input String
Given a list, return all the permutations of the list.
Given a list, return all the permutations of the list.
-- the list
all the permutations of the list
Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).
Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).
the list to permute
all the permutations of the list including sublists, sorted in longest to shortest
Replaces the value found in a string surrounded by <%= .
Replaces the value found in a string surrounded by <%= ... %> by a replacement according to the value found in the subst Map.
Throws an exception if no correspondance can be found.
string where replacements should be done
map of [regular expression with groups, replacement]
Create a random string of a given size.
Create a random string of a given size. 5 bits of randomness per character
size of the string to create. Must be a positive integer.
the generated string
Split a string according to a separator
Split a string according to a separator
a regexp to use with the String::split method
a list of trimmed parts whose length is > 0
Given an incoming list, return a set of lists that is the original list rotated through all its positions
Given an incoming list, return a set of lists that is the original list rotated through all its positions
the list to rotate
all the rotations of the list
Turn a string of format "FooBar" into snake case "foo_bar"
Turn a string of format "FooBar" into snake case "foo_bar"
Note: snakify is not reversible, ie. in general the following will _not_ be true:
s == camelify(snakify(s))
the underscored string
Split a string in 2 parts at the first place where a separator is found
Split a string in 2 parts at the first place where a separator is found
a List containing a pair of the 2 trimmed parts
Split a string separated by a point or by a column in 2 parts.
Split a string separated by a point or by a column in 2 parts. Uses default values if only one is found or if no parts are found
string to split
default value for the first part if no split can be done
default value for the second part if one or less parts can be found
a pair containing the first and second parts
Splits a string of the form <name1=value1, name2=value2, .
Splits a string of the form <name1=value1, name2=value2, ... > and unquotes the quoted values. The result is a Map[String, String]
a SuperString with more available methods such as roboSplit or commafy
Add utility methods to Lists
Add utility methods to Lists
If str is surrounded by quotes it return the content between the quotes
If str is surrounded by quotes it return the content between the quotes
(Since version 2.3) Use blankForNull instead