Methods | Description |
Check if the string is 'blank', meaning either empty or containing only whitespace. | |
Converts a string separated by dashes into a camelCase equivalent. For instance, 'foo-bar' would be converted to 'fooBar'. | |
Capitalizes the first letter of a string and downcases all the others. | |
Replaces every instance of the underscore character ("_") by a dash ("-"). | |
Checks if the string is empty. | |
Checks if the string ends with substring. | |
Converts HTML special characters to their entity equivalents. | |
Evaluates the JSON in the string and returns the resulting object. | |
Evaluates the content of any script block present in the string. Returns an array containing the value returned by each script. | |
Extracts the content of any script block present in the string and returns them as an array of strings. | |
Returns the string with every occurrence of a given pattern replaced by either a regular string, the returned value of a function or a Template string. | |
Check if the string contains a substring. | |
Returns a debug-oriented version of the string. | |
Treats the string as a Template and fills it with object's properties. | |
Check if the string is valid JSON by the use of regular expressions. This security method is called internally. | |
Parses a URI-like query string and returns an object composed of parameter/value pairs. | |
Allows iterating over every occurrence of the given pattern | |
Checks if the string starts with substring. | |
Strips all leading and trailing whitespace from a string. | |
Strips a string of anything that looks like an HTML script block. | |
Strips a string of any HTML tag. | |
Returns a string with the first count occurrences of pattern replaced by either a regular string, the returned value of a function or a Template string. | |
Used internally by ObjectRange. Converts the last character of the string to the following character in the Unicode alphabet. | |
Concatenates the string count times. | |
Splits the string character-by-character and returns an array with the result. | |
Returns a JSON string. | |
Parses a URI-like query string and returns an object composed of parameter/value pairs. | |
Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt). | |
Converts a camelized string into a series of words separated by an underscore ("_"). | |
Strips tags and converts the entity forms of special HTML characters to their normal form. | |
Strips comment delimiters around Ajax JSON or JavaScript responses. This security method is called internally. |
Nov 28, 2008
Prototype String Methods
Prototype enhances the String object with a series of useful methods ranging from the trivial to the complex.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment