5.5.1. String — Manipulates strings¶
The String module provides a number of common functions for manipulating strings.
TODO: Expand this a bit.
This module defines the following functions:
- String.Encode(string)¶
Encodes a string in a format suitable for including in a HTTP request.
Parameter: string (str) – The string to encode Returns: The encoded string Return type: str
- String.Decode(string)¶
Decodes a string previously encoded with the String.Encode() function.
Parameter: string (str) – The string to decode Returns: The decoded string Return type: str
- String.Quote(string, usePlus=False)¶
Escapes certain characters in a string, making it suitable for use as a URL request parameter.
Parameters: - string (str) – The string to escape
- usePlus (bool) – Specifies whether space characters should be replaced with a + character or %20 character code.
Returns: The escaped string
Return type: str
- String.Unquote(string, usePlus=False)¶
Unescapes a previously escaped string.
Parameters: - string (str) – The string to unescape
- usePlus (bool) – Specifies whether space characters are represented by a + character or %20 character code.
Returns: The unescaped string
Return type: str
- String.StripTags(html)¶
Removes the tags from a given HTML string.
Parameter: html (str) – The HTML string to remove the tags from Returns: The string with any HTML tags removed Return type: str