Robin Pars, Laurence Moroney, and John Grieb
"Foundations of ASP.NET AJAX"
Other than
two formatting methods (similar to those found in the Date and Number extensions), the
String extension includes a few trimming methods among others as shown in Table 4-8.
Table 4-8.Methods of the String Extension
Method Name Description
endsWith Returns a boolean value indicating whether or not the end of the
String object matches the specified string
format Formats a string by replacing placeholders with provided values
CHAPTER 4 ?– ASP.NET AJAX CLIENT LIBRARIES 64
localeFormat Formats a string by replacing placeholders with provided values with
locale specificity
startsWith Returns a boolean value indicating whether or not the start of the
String object matches the specified string
trim Removes leading and trailing spaces from a String object
trimEnd Removes trailing spaces from a String object
trimStart Removes leading white spaces from a String object
The following small script illustrates usage of some of the main methods of the
String extension: