どうも、ちょげ(@chogetarou)です。
文字列(string)を全て大文字に変換する方法を紹介します。
方法

文字列(string)を全て大文字に変換するには、toUpperCase()を使います。
具体的には、文字列からtoUpperCase()を呼び出します。
//text=対象の文字列
let result = text.toUpperCase();
上記のtoUpperCase()は、対象の文字列(string)を全て大文字に変換した文字列を生成します。
使用例
let text = "Hello,World";
let result = text.toUpperCase();
console.log(result);
出力:
HELLO,WORLD
コメント