0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

文字列のメソッド

Posted at
s = 'my name is Mike.hi Mike.'
is_true = s.startswith('my name')
print(is_true) #True

print(s.find('Mike')) #11 前から検索
print(s.rfind('Mike')) #19 後ろから検索
print(s.title()) #My Name Is Mike.Hi Mike.
print(s.capitalize()) #My name is mike.hi mike.
print(s.upper()) #MY NAME IS MIKE.HI MIKE.
print(s.lower()) #my name is mike.hi mike.
print(s.count('m')) #2
print(s.replace('Mike', 'Nancy')) #my name is Nancy.hi Nancy.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?