December 2000
Intermediate to advanced
816 pages
16h 57m
English
String methods were recently added to Python, introduced in version 1.6 (and in JPython 1.1), and tweaked for 2.0. These methods are intended to replace most of the functionality in the string module as well as to bring new functionality to the table. Table 6.6 shows all the current methods for strings. All string methods should fully support Unicode strings. And some are applicable only to Unicode strings.
| Value | Description |
|---|---|
| string.capitalize() | capitalizes first letter of string |
| string.center(width) | returns a space-padded string with the original string centered to a total of width columns |
| string.count(str, beg= 0,end=len(string)) | counts how many times str occurs in string, or in a ... |
Read now
Unlock full access