エンジニアとしての市場価値を測りませんか?PR

企業からあなたに合ったオリジナルのスカウトを受け取って、市場価値を測りましょう

0
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 3 years have passed since last update.

文字列を操作するメソッド

Posted at

よく使う文字列系メソッドについてまとめる.
※今後も継続して追加予定

###trim()メソッド
trimメソッドは,文字列の両端の空白を削除した文字列を返すメソッド.

const str = '   Hello!    '
console.log(str.trim())
//Hello!

###split()メソッド
splitメソッドは,引数で渡した文字列を取り除き,その前後で文字列の配列を生成するメソッド.

const str = 'abcdefg'
console.log(str.split('d'))
//['abc','efg']
console.log(str.split('de'))
//['abc','fg']
0
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

Comments

No comments

Let's comment your feelings that are more than good

0
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?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address