String Methods

 0    48 tarjetas    sir
descargar mp3 imprimir jugar test de práctica
 
término definición
Capitalizes first letter of string
empezar lección
capitalize()
Returns a string padded with fillchar with the original string CENTERED to a total of width columns.
empezar lección
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.
empezar lección
count(str, beg = 0, end = len(string))
Decodes the string using the codec registered for encoding. encoding defaults to the default string encoding.
empezar lección
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'.
empezar lección
encode(encoding = 'UTF-8', errors = 'strict')
Expands tabs in string to multiple spaces
defaults to 8 spaces per tab if tabsize not provided.
empezar lección
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.
empezar lección
find(str, beg = 0 end = len(string))
Same as find(), but raises an exception if str not found.
empezar lección
index(str, beg = 0, end = len(string))
Returns true if string has at least 1 character and all characters are alphanumeric and false otherwise.
empezar lección
isalnum()
Returns true if string has at least 1 character and all characters are alphabetic and false otherwise.
empezar lección
isalpha()
Returns true if string contains only digits and false otherwise.
empezar lección
isdigit()
Returns true if string has at least 1 cased character and all cased characters are in lowercase and false otherwise.
empezar lección
islower()
Returns true if a unicode string contains only numeric characters and false otherwise.
empezar lección
isnumeric()
Returns true if string contains only whitespace characters and false otherwise.
empezar lección
isspace()
Returns true if string is properly "titlecased" and false otherwise.
empezar lección
istitle()
Returns true if string has at least one cased character and all cased characters are in uppercase and false otherwise.
empezar lección
isupper()
Merges (concatenates) the string representations of elements in sequence seq into a string, with separator string.
empezar lección
join(seq)
Returns the length of the string
empezar lección
len(string)
Returns a space-padded string with the original string left-justified to a total of width columns.
empezar lección
ljust(width[, fillchar])
Converts all uppercase letters in string to lowercase.
empezar lección
lower()
Removes all leading whitespace in string.
empezar lección
lstrip()
Returns a translation table to be used in translate function.
empezar lección
maketrans()
Returns the max alphabetical character from the string str.
empezar lección
max(str)
Returns the min alphabetical character from the string str.
empezar lección
min(str)
Replaces all occurrences of old in string with new or at most max occurrences if max given.
empezar lección
replace(old, new [, max])
Same as find(), but search backwards in string.
empezar lección
rfind(str, beg = 0, end = len(string))
Same as index(), but search backwards in string.
empezar lección
rindex(str, beg = 0, end = len(string))
Returns a space-padded string with the original string right-justified to a total of width columns.
empezar lección
rjust(width,[, fillchar])
Removes all trailing whitespace of string.
empezar lección
rstrip()
Splits string according to delimiter str (space if not provided) and returns list of substrings
empezar lección
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.
empezar lección
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.
empezar lección
startswith(str, beg=0, end=len(string))
Performs both lstrip() and rstrip() on string
empezar lección
strip([chars])
Inverts case for all letters in string.
empezar lección
swapcase()
Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.
empezar lección
title()
Translates string according to translation table str(256 chars), removing those in the del string.
empezar lección
translate(table, deletechars="")
Converts lowercase letters in string to uppercase.
empezar lección
upper()
Returns original string leftpadded with zeros to a total of width characters
intended for numbers, it retains any sign given (less one zero).
empezar lección
zfill (width)
Returns true if a unicode string contains only decimal characters and false otherwise.
empezar lección
isdecimal()
Converts string into lower case
empezar lección
casefold()
Returns True if the string is an identifier
empezar lección
isidentifier()
Returns a tuple where the string is parted into three parts
empezar lección
partition()
Splits the string at the specified separator, and returns a list
empezar lección
rsplit()
Splits the string at the specified separator, and returns a list
empezar lección
rsplit()
Returns a tuple where the string is parted into three parts
empezar lección
partition()
Returns a tuple where the string is parted into three parts
empezar lección
rpartition()
Removes prefix.
empezar lección
. removeprefix()
Removes suffix.
empezar lección
. removesuffix()

Debes iniciar sesión para poder comentar.