StringExtensions extension

Extensions for String to simplify common validation and formatting tasks.

on

Properties

isNumeric bool

Available on String, provided by the StringExtensions extension

Returns true if the string is numeric.
no setter
isStrongPassword bool

Available on String, provided by the StringExtensions extension

Returns true if the string is a strong password. (At least 8 characters, 1 uppercase, 1 lowercase, 1 number, 1 special char)
no setter
isValidEmail bool

Available on String, provided by the StringExtensions extension

Returns true if the string is a valid email address.
no setter
isValidPhone bool

Available on String, provided by the StringExtensions extension

Returns true if the string is a valid phone number (basic check).
no setter

Methods

capitalize() String

Available on String, provided by the StringExtensions extension

Capitalizes the first letter of the string.
toTitleCase() String

Available on String, provided by the StringExtensions extension

Converts the string to Title Case.
truncate(int maxChars) String

Available on String, provided by the StringExtensions extension

Truncates the string if it's longer than maxChars.