Latest web development tutorials

Pythonのistitle()メソッド

Python文字列 Python文字列


説明

Pythonのistitle()すべての単語を検出する方法は、文字列が小文字に大文字の最初の文字と他の文字をある綴られています。

文法

istitle()メソッドの構文:

str.istitle()

パラメータ

  • なし。

戻り値

文字列がすべての単語が綴られている場合は最初の文字は大文字、真の小文字や他戻り、そうでない場合はFalseです。

次の例では、istitle()メソッドの例を示します。

#!/usr/bin/python


str = "This Is String Example...Wow!!!";
print str.istitle();

str = "This is string example....wow!!!";
print str.istitle();

次のように上記の出力結果の例は次のとおりです。

True
False

Python文字列 Python文字列