StringExtensions extension

on

Properties

first String

Available on String, provided by the StringExtensions extension

The first character in this String.
no setter
tryFirst String?

Available on String, provided by the StringExtensions extension

The first character in this String or null if this String is empty.
no setter

Methods

capitalize() String

Available on String, provided by the StringExtensions extension

Returns a new String by transforming the first character of this String to uppercase and all other characters to lowercase.
replaceLast(Pattern from, String to) String

Available on String, provided by the StringExtensions extension

Creates a new string with the last occurrence of from replaced by to.
splitOnce(Pattern p) Tuple2<String, String>

Available on String, provided by the StringExtensions extension

Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
toCamelCase() String

Available on String, provided by the StringExtensions extension

Returns a new String by turning snake_case into CamelCase.
toSnakeCase() String

Available on String, provided by the StringExtensions extension

Returns a new String by turning CamelCase into snake_case.
trimLeftLength(int length) String

Available on String, provided by the StringExtensions extension

The string trimmed from the left side by the given length.
trimLength(int length) String

Available on String, provided by the StringExtensions extension

The string trimmed from both sides by the given length.
trimRightLength(int length) String

Available on String, provided by the StringExtensions extension

The string trimmed from the right side by the given length.