Overview

문자열 함수를 잘 다루면 변수명을 필터링하거나 텍스트 데이터를 처리할 때 매우 유용하다. 총 47개의 메서드가 있다.

len
lower
upper
strip
replace
split
find
join
startswith
endswith
capitalize
title
isalpha
isdigit
isspace
isupper
islower
zfill
casefold
count
isalnum
swapcase

대소문자 변환

my_str = "HELLO world!"

공백 및 문자 제거

my_str = "   Hello, Python World!   " 

검색과 판별

my_str = "apple, banana and pineapple"