Collection Classes
collections.UserString()
Wrap string data in a subclass-friendly object. String operations produce values rather than modifying immutable underlying string data.
Formal Syntax & Structure
python syntaxpython
collections.UserString(seq)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| seq | str | Text used to initialize the wrapper. |
Return Value
UserString
The UserString result described above.
Working Example
Example Snippetpython
import collectionsu=collections.UserString("abc")print(str(u.upper()))