1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

小文字を大文字にする方法 [D014:小文字を大文字に][paiza]

Last updated at Posted at 2018-09-30

###:runner:文字列をtoUpperCaseメソッドで大文字に変換する:basketball_player_tone5:###

文字列に対して呼び出す

var line = "abc"
var str = line.toUpperCase();
 
↓↓↓↓↓↓↓ あなたの記事の内容
    console.log(str);
    =>ABC

⬆️大文字を小文字に変換するときは、toLowerCaseメソッドを使用

───────

Uppercaseを使って文字列の先頭を大文字にしたものを出力する


var str = "repezen";
var str_uppercase = str[0].toUpperCase() + str.slice(1);

console.log(str_uppercase);
=> "Repezen"

↑↑↑↑↑↑↑ 編集リクエストの内容

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?