String Class
Q extended methods for Strings
Item Index
Methods
decodeHTML
-
[convert]
Reverses what encodeHTML does
Parameters:
-
[convert]
Array optionalArray of codes to unconvert. Can include '&', '<', '>, '"', ''', "
", "
"
Returns:
encodeHTML
-
[convert]
Returns a copy of the string with special HTML characters escaped
Parameters:
-
[convert]
Array optionalArray of characters to convert. Can include '&', '<', '>', '"', "'", "\n"
Returns:
interpolate
-
fields
Interpolates some fields into the string wherever "{{fieldName}}" appears or {{index}} appears.
Parameters:
Returns:
parseUrl
-
component
Analogous to PHP's parse_url function
Parameters:
-
component
StringOptional name of component to return
Returns:
queryField
-
name
-
[value]
Get or set querystring fields from a string, usually from location.search or location.hash
Parameters:
-
name
String | Array | ObjectThe name of the field. If it's an array, returns an object of {name: value} pairs. If it's an object, then they are added onto the querystring and the result is returned. If it's a string, it's the name of the field to get. And if it's an empty string, then we get the array of field names with no value, e.g. ?123&456&a=b returns [123,456]
-
[value]
String optionalOptional, provide a value to set in the querystring, or null to delete any fields that match name as a RegExp