string methods (brief) Flashcards
1
Q
Special point about string methods
A
All string methods returns new values. They do not change the original string.
2
Q
capitalize()
A
Converts the first character to upper case
3
Q
casefold()
A
Converts string into lower case
4
Q
center()
A
Returns a centered string
5
Q
count()
A
Returns the number of times a specified value occurs in a string
6
Q
encode()
A
Returns an encoded version of the string
7
Q
endswith()
A
Returns true if the string ends with the specified value
8
Q
expandtabs()
A
Sets the tab size of the string
9
Q
find()
A
Searches the string for a specified value and returns the position of where it was found
10
Q
format()
A
Formats specified values in a string
11
Q
format_map()
A
Formats specified values in a string