LoginSignup
0
0

More than 3 years have passed since last update.

lstripとrstripのどっちがどっちか二度と忘れない

Posted at

リファレンスマニュアルには先頭とか、末尾とか書いてあるので、lead?rear?とか考えたけど、

"l" = left
"r" = right

これでいいですよね。

lstrip -> String

文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。空白文字の定義は " \t\r\n\f\v" です。

rstrip -> String

文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。空白文字の定義は " \t\r\n\f\v\0" です。

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