String Methods

 0    48 kartičky    sir
stáhnout mp3 Vytisknout hrát zkontrolovat se
 
otázka odpověď
Capitalizes first letter of string
začněte se učit
capitalize()
Returns a string padded with fillchar with the original string CENTERED to a total of width columns.
začněte se učit
center(width, fillchar)
Counts how many times str occurs in string or in a substring of string if starting index beg and ending index end are given.
začněte se učit
count(str, beg = 0, end = len(string))
Decodes the string using the codec registered for encoding. encoding defaults to the default string encoding.
začněte se učit
decode(encoding = 'UTF-8', errors = 'strict')
Returns encoded string version of string
on error, default is to raise a ValueError unless errors is given with 'ignore' or 'replace'.
začněte se učit
encode(encoding = 'UTF-8', errors = 'strict')
Expands tabs in string to multiple spaces
defaults to 8 spaces per tab if tabsize not provided.
začněte se učit
expandtabs(tabsize = 8)
Determine if str occurs in string or in a substring of string if starting index beg and ending index end are given returns index if found and -1 otherwise.
začněte se učit
find(str, beg = 0 end = len(string))
Same as find(), but raises an exception if str not found.
začněte se učit
index(str, beg = 0, end = len(string))
Returns true if string has at least 1 character and all characters are alphanumeric and false otherwise.
začněte se učit
isalnum()
Returns true if string has at least 1 character and all characters are alphabetic and false otherwise.
začněte se učit
isalpha()
Returns true if string contains only digits and false otherwise.
začněte se učit
isdigit()
Returns true if string has at least 1 cased character and all cased characters are in lowercase and false otherwise.
začněte se učit
islower()
Returns true if a unicode string contains only numeric characters and false otherwise.
začněte se učit
isnumeric()
Returns true if string contains only whitespace characters and false otherwise.
začněte se učit
isspace()
Returns true if string is properly "titlecased" and false otherwise.
začněte se učit
istitle()
Returns true if string has at least one cased character and all cased characters are in uppercase and false otherwise.
začněte se učit
isupper()
Merges (concatenates) the string representations of elements in sequence seq into a string, with separator string.
začněte se učit
join(seq)
Returns the length of the string
začněte se učit
len(string)
Returns a space-padded string with the original string left-justified to a total of width columns.
začněte se učit
ljust(width[, fillchar])
Converts all uppercase letters in string to lowercase.
začněte se učit
lower()
Removes all leading whitespace in string.
začněte se učit
lstrip()
Returns a translation table to be used in translate function.
začněte se učit
maketrans()
Returns the max alphabetical character from the string str.
začněte se učit
max(str)
Returns the min alphabetical character from the string str.
začněte se učit
min(str)
Replaces all occurrences of old in string with new or at most max occurrences if max given.
začněte se učit
replace(old, new [, max])
Same as find(), but search backwards in string.
začněte se učit
rfind(str, beg = 0, end = len(string))
Same as index(), but search backwards in string.
začněte se učit
rindex(str, beg = 0, end = len(string))
Returns a space-padded string with the original string right-justified to a total of width columns.
začněte se učit
rjust(width,[, fillchar])
Removes all trailing whitespace of string.
začněte se učit
rstrip()
Splits string according to delimiter str (space if not provided) and returns list of substrings
začněte se učit
split(str="", num=string. count(str))
split into at most num substrings if given.
Splits string at all (or num) NEWLINEs and returns a list of each line with NEWLINEs removed.
začněte se učit
splitlines(num=string. count('\n'))
Determines if string or a substring of string (if starting index beg and ending index end are given) starts with substring str
returns true if so and false otherwise.
začněte se učit
startswith(str, beg=0, end=len(string))
Performs both lstrip() and rstrip() on string
začněte se učit
strip([chars])
Inverts case for all letters in string.
začněte se učit
swapcase()
Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.
začněte se učit
title()
Translates string according to translation table str(256 chars), removing those in the del string.
začněte se učit
translate(table, deletechars="")
Converts lowercase letters in string to uppercase.
začněte se učit
upper()
Returns original string leftpadded with zeros to a total of width characters
intended for numbers, it retains any sign given (less one zero).
začněte se učit
zfill (width)
Returns true if a unicode string contains only decimal characters and false otherwise.
začněte se učit
isdecimal()
Converts string into lower case
začněte se učit
casefold()
Returns True if the string is an identifier
začněte se učit
isidentifier()
Returns a tuple where the string is parted into three parts
začněte se učit
partition()
Splits the string at the specified separator, and returns a list
začněte se učit
rsplit()
Splits the string at the specified separator, and returns a list
začněte se učit
rsplit()
Returns a tuple where the string is parted into three parts
začněte se učit
partition()
Returns a tuple where the string is parted into three parts
začněte se učit
rpartition()
Removes prefix.
začněte se učit
. removeprefix()
Removes suffix.
začněte se učit
. removesuffix()

Chcete-li přidat komentář, musíte se přihlásit.