String Methods

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

コメントを投稿するにはログインする必要があります。