Python3 upper()メソッド

Python3 字符串Python3 文字列


説明

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

構文

upper()メソッドの構文:

str.upper()

引数

  • NA。

戻り値

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

例

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

#!/usr/bin/python3

str = "this is string example from サンプル....wow!!!";

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

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

str.upper() :  THIS IS STRING EXAMPLE FROM サンプル....WOW!!!

Python3 字符串Python3 文字列

その他の拡張