You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Replacing

replace(text, String repl, String with)

Replaces all occurrences of a String within another String.

replace(text, String repl, String with, int max)

Replaces a String with another String inside a larger String, for the first max values of the search String.

replaceOnce(text, String repl, String with)

Replaces a String with another String inside a larger String, once.

Samples

number decimal separator to "."

return replace(value(), ".", ",")

Trimming and whitespaces cleaning

strip(str, String stripChars)

Strips any of a set of characters from the start and end of a String.

String[] stripAll(String[] strs)

Strips whitespace from the start and end of every String in an array.

String[] stripAll(String[] strs, String stripChars)

Strips any of a set of characters from the start and end of every String in an array.

stripEnd(str, String stripChars)

Strips any of a set of characters from the end of a String.

stripStart(str, String stripChars)

Strips any of a set of characters from the start of a String.

trim(str)

Removes control characters (char <= 32) from both ends of this String, handling null by returning null.

chomp(str)

Removes one newline from end of a String if it's there, otherwise leave it alone.

chomp(str, String separator)

Removes separator from the end of str if it's there, otherwise leave it alone.

deleteWhitespace(str)

Deletes all whitespaces from a String.

Samples

Basic trimming of all whitespaces after and before cell content:

return trim(value());

Case manipulation

swapCase(str)

Swaps the case of a String changing upper and title case to lower case, and lower case to upper case.

uncapitalize(str)

Uncapitalizes a String changing the first letter to title case.

lowerCase(str)

Converts a String to lower case as per String.toLowerCase().

upperCase(str)

Converts a String to upper case.

Next steps:

 

  • No labels