Generated by
JDiff

Class org.cyclos.utils.StringHelper

Added Methods
void forEachLine(String, boolean, Function<String, Boolean>) Calls the given function for each non-empty while it return true, trimmed line of the given string.
void forEachLine(String, boolean, Procedure<String>) Calls the given procedure for each non-empty untils the last line, trimmed line of the given string.
String joinTrimming(Collection<?>, String) Like .join(Collection, String), but each part is trimmed, and not used if empty
List<String> splitTrimming(String, String) Like .split(String, String), but each part is trimmed, and not used if empty
String truncateLines(String, int, int) Truncates the given string to a maximum of lines, making each line have a maximum of characters.
 

Changed Methods
String defaultValue(String, String) Documentation changed from old to new.
Returns the value of the second string if the first is blank.
String removeEnd(String, String) Documentation changed from old to new.
Removes the end of the given string, or returns the original string if end is null or not the final part of the string
  • removeEnd(null, *) == null
  • removeEnd(x, *) == x
  • removeEnd("car", "ar") == "c"
  • removeEnd("car", "r") == "ca"
  • removeEnd("car", "x") == "car"
String removeStart(String, String) Documentation changed from old to new.
Removes the start of the given string, or returns the original string if end is null or not the initial part of the string
  • removeStart(null, *) == null
  • removeStart(x, *) == x
  • removeStart("car", "ca") == "r"
  • removeStart("car", "c") == "ar"
  • removeStart("car", "x") == "car"
String replaceVariables(String, Map<String, String>) Documentation changed from old to new.
Replaces variables in the form {varname} with the ones in the map.
List<String> split(String, String) Documentation changed from old to new.
Splits a string into an array according to the char specified as separator.
String truncate(String, int) Documentation changed from old to new.
Truncates the given string without cutting words in the middle, and appending ellipsis in the end.
String replace(String, String, String, int) Documentation changed from old to new.
Replaces a specified number of occurrences (-1 means unlimited) of the source text with the destination text in the given string