LoginSignup
6
6

More than 5 years have passed since last update.

マルチバイト文字列を適当なバイト数でカットしても最後の文字を化けさせない

Last updated at Posted at 2013-01-25
"あいうえお"[0,10].slice(/\A.{0,}/m) # => あいう

[0,10]がバイトで処理される1.8.7において、です。
1.9以降は(基本)文字数で処理されます。

6
6
2

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