Latest web development tutorials

python3 istitle()メソッド

python3文字列 python3文字列


説明

すべての単語の文字列を綴られている検出するistitle()メソッドは、大文字の最初の文字と小文字に他の文字です。

文法

istitle()メソッドの構文:

str.istitle()

パラメータ

  • なし。

戻り値

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

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

#!/usr/bin/python3


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

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

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

True
False

python3文字列 python3文字列