Created
November 27, 2013 17:13
-
-
Save timothyekl/7679418 to your computer and use it in GitHub Desktop.
Test for http://mortoray.com/2013/11/27/the-string-type-is-broken/ in Ruby
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
str = "noël" # decomposed | |
puts str.reverse # expect lëon | |
puts str[0..2] # expect noë | |
puts str.length # expect 4 | |
str = "😸😾" # emoji | |
puts str.reverse # expect 😾😸 | |
puts str[1..str.length] # expect 😾 | |
puts str.length # expect 2 | |
str = "baffle" # with ligature | |
puts str.upcase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment