Python upper()メソッド

Python 字符串Python 文字列


説明

Python upper() メソッドは、文字列内の小文字を大文字に変換します。

構文

upper() メソッドの構文:

str.upper()

パラメータ

  • NA。

戻り値

小文字を大文字に変換した文字列を返します。

例

以下の例は、upper() 関数の使用方法を示しています:

#!/usr/bin/python

str = "this is string example....wow!!!";

print "str.upper() : ", str.upper()

上記の例の出力結果は次のとおりです:

str.upper() :  THIS IS STRING EXAMPLE....WOW!!!

Python 字符串Python 文字列

その他の拡張