String object methods in Python

This is my first post.

I recently started Python on my own, so this time I'll list some ** methods for strings **. Hereafter, the character string object to be handled is string.

Converts only the beginning of the string to uppercase

Convert all characters to lowercase so that you can search for strings, ignoring case

Centers the string with the specified number of characters. Fill in the blank with the character string specified by'char'.

Returns the number of times the string contains'search'. In the following code, the character strings are counted so that they do not overlap.

test.py


>>>'aaaaaa'.count('aaa')
2

Check for a match at the end of the string. When the start position and end position are specified, the same rules as the slice operation ((3, -4), etc.) are used.

See Resources for more information.

--References Atsuo Ishimoto: Detailed explanation of Python grammar, O'Reilly Japan, 2014 [From Amazon](http://www.amazon.co.jp/Python%E6%96%87%E6%B3%95%E8%A9%B3%E8%A7%A3-%E7%9F%B3% E6% 9C% AC-% E6% 95% A6% E5% A4% AB / dp / 4873116880 / ref = sr_1_1? S = books & ie = UTF8 & qid = 1455374675 & sr = 1-1 & keywords = python% E6% 96% 87% E6% B3 % 95% E8% A9% B3% E8% A7% A3)

Recommended Posts

String object methods in Python
String manipulation in python
Object oriented in python
Create a datetime object from a string in Python (Python 3.3)
Insert an object inside a string in Python
Null object comparison in Python
String date manipulation in Python
Dynamically call methods in Python
Python string
6 ways to string objects in Python
Dynamically define functions (methods) in Python
Create a random string in Python
Quadtree in Python --2
Python in optimization
CURL in python
Python: String concatenation
Conversion of string <-> date (date, datetime) in Python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
python string slice
Python built-in object
Meta-analysis in Python
Unittest in python
Create a JSON object mapper in Python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
Python built-in object
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Private methods and fields in python [encryption]
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
Summary of built-in methods in Python list
N-gram in python
Generate a class from a string in Python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Python2 string type
Python string format
Constant in python
Python # string type
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python