StringExtensions extension

Extension methods for String type.

on

Properties

capitalized String

Available on String, provided by the StringExtensions extension

Capitalizes only the first letter of the string.
no setter
lettersOnly String

Available on String, provided by the StringExtensions extension

Removes all characters except letters (a-z, A-Z).
no setter
numbersOnly String

Available on String, provided by the StringExtensions extension

Removes all characters except digits (0-9).
no setter
numbersWithDecimal String

Available on String, provided by the StringExtensions extension

Removes all characters except digits and decimal point (0-9 and .).
no setter
removeCommas String

Available on String, provided by the StringExtensions extension

Removes commas from the string.
no setter

Methods

add(String value) String

Available on String, provided by the StringExtensions extension

Adds (concatenates) a string to this string.
dropFirst() String

Available on String, provided by the StringExtensions extension

Returns a new string with the first character removed.
dropLast() String

Available on String, provided by the StringExtensions extension

Returns a new string with the last character removed.
fromReadable() double?

Available on String, provided by the StringExtensions extension

Parses a readable number string with K, M, B, T suffixes to a double. Automatically handles K (thousand), M (million), B (billion), T (trillion).
fromReadableInt() int?

Available on String, provided by the StringExtensions extension

Parses a readable number string with K, M, B, T suffixes to an int. Returns null if the string cannot be parsed.
toDoubleSafe() double?

Available on String, provided by the StringExtensions extension

Converts this string to a double, removing commas and other formatting first.
toIntSafe() int?

Available on String, provided by the StringExtensions extension

Converts this string to an int, removing commas and other formatting first.