- empty() - checks if a string is empty
var myEmptyString = ""; if (myEmptyString.empty()) alert ('myEmptyString is empty');
- blank() - checks if a string is either empty or contains white space
var myBlankString = " "; if (myBlankString.blank()) alert ('myBlankString is blank');
- capitalize() - capitalizes the first letter in a string
var myString = "lower_case_string"; // Will show an alert with "Lower_case_string" alert(myString.capitalize());
- gsub(pattern, replacement) - replaces a pattern in the string with the string specified in 'replacement'
var myString = "some_string"; // Will show an alert with "some string" alert(myString.gsub('_', ' '));
- endsWith(substring) - checks if the specified string ends with the provided 'substring'
var myString = "some string_"; // Will show an alert with "myString ends with _" if (myString.endsWith('_')) alert('myString ends with _');