string
|
upper(s)
Return a copy of the string s converted to uppercase. |
|
|
string
|
capitalize(s)
Return a copy of the string s with only its first character
capitalized. |
|
|
string
|
lstrip(s)
Return a copy of the string s with leading whitespace removed. |
|
|
|
replace(s,
old,
new,
maxsplit=0)
replace (str, old, new[, maxsplit]) -> string |
|
|
|
capwords(s,
sep=None)
capwords(s, [sep]) -> string |
|
|
string
|
expandtabs(s,
tabsize=...)
Return a copy of the string s with all tab characters replaced by the
appropriate number of spaces, depending on the current column, and
the tabsize (default 8). |
|
|
string
|
strip(s)
Return a copy of the string s with leading and trailing whitespace
removed. |
|
|
string
|
ljust(s,
width)
Return a left-justified version of s, in a field of the specified
width, padded with spaces as needed. |
|
|
int
|
index(s,
sub,
start=... ,
end=...)
Like find but raises ValueError when the substring is not found. |
|
|
int
|
rindex(s,
sub,
start=... ,
end=...)
Like rfind but raises ValueError when the substring is not found. |
|
|
in
|
find(s,
sub,
start=... ,
end=...)
Return the lowest index in s where substring sub is found, such that
sub is contained within s[start,end]. |
|
|
list of strings
|
splitfields(str,
sep=... ,
maxsplit=...)
Return a list of the words in the string s, using sep as the
delimiter string. |
|
|
list of strings
|
split(str,
sep=... ,
maxsplit=...)
Return a list of the words in the string s, using sep as the
delimiter string. |
|
|
string
|
rstrip(s)
Return a copy of the string s with trailing whitespace removed. |
|
|
string
|
translate(s,
table,
deletechars=...)
Return a copy of the string s, where all characters occurring in the
optional argument deletechars are removed, and the remaining
characters have been mapped through the given translation table,
which must be a string of length 256. |
|
|
int
|
count(s,
sub,
start=...,
end=...)
Return the number of occurrences of substring sub in string
s[start:end]. |
|
|
string
|
joinfields(list,
sep=...)
Return a string composed of the words in list, with intervening
occurrences of sep. |
|
|
string
|
rjust(s,
width)
Return a right-justified version of s, in a field of the specified
width, padded with spaces as needed. |
|
|
string
|
lower(s)
Return a copy of the string s converted to lowercase. |
|
|
string
|
swapcase(s)
Return a copy of the string s with upper case characters converted to
lowercase and vice versa. |
|
|
int
|
atoi(s,
base=...)
Return the integer represented by the string s in the given base,
which defaults to 10. |
|
|
long
|
atol(s,
base=...)
Return the long integer represented by the string s in the given
base, which defaults to 10. |
|
|
float
|
atof(s)
Return the floating point number represented by the string s. |
|
|
string
|
join(list,
sep=...)
Return a string composed of the words in list, with intervening
occurrences of sep. |
|
|
string
|
center(s,
width)
Return a center version of s, in a field of the specified width. |
|
|
int
|
rfind(s,
sub,
start=... ,
end=...)
Return the highest index in s where substring sub is found, such that
sub is contained within s[start,end]. |
|
|
string
|
zfill(x,
width)
Pad a numeric string x with zeros on the left, to fill a field of the
specified width. |
|
|