{"id":25821,"date":"2021-12-16T09:19:14","date_gmt":"2021-12-16T03:49:14","guid":{"rendered":"https:\/\/python-programs.com\/?p=25821"},"modified":"2021-12-16T09:19:14","modified_gmt":"2021-12-16T03:49:14","slug":"python-program-for-collections-userstring-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-collections-userstring-function\/","title":{"rendered":"Python Program for collections.UserString Function"},"content":{"rendered":"

Python collections.UserString() Function:<\/strong><\/p>\n

Python’s collections module includes a String-like container called UserString. This class serves as a wrapper class for string objects. This class is useful when one wants to create their own string with modified or new functionality. It can be thought of as a method of adding new behaviors to the string. This class takes any string-convertible argument and simulates a string whose content is kept in a regular string. This class’s data attribute provides access to the string.<\/p>\n

Syntax:<\/strong><\/p>\n

collections.UserString(sequence)<\/pre>\n

Program for collections.UserString Function in Python<\/h2>\n