-
-
Save cheald/07bb1729fee1cd892bbd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> "テスト’[ruby-core:62842] [Bug #9882]".slice(4..-1) | |
=> "[ruby-core:62842] [Bug #9882]" | |
> String.new("\u{30c6 30b9 30c8 2019}#{'[ruby-core:62842] [Bug #9882]'}").slice(4..-1) | |
=> "[ruby-core:62842] [Bug #9882]" | |
> bug9882 = '[ruby-core:62842] [Bug #9882]' | |
=> "[ruby-core:62842] [Bug #9882]" | |
> str = String.new("\u{30c6 30b9 30c8 2019}#{bug9882}") | |
=> "テスト’[ruby-core:62842] [Bug #9882]" | |
> str.slice(4..-1) | |
=> "\x82\xB9ト’[ruby-core:62842] [Bug #9882]" | |
> bug9882.ascii_only? | |
=> true | |
> str.ascii_only? | |
=> true | |
> "テスト’[ruby-core:62842] [B#9882]".ascii_only? | |
=> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment