Last active
March 28, 2016 16:34
-
-
Save ckhrysze/76ece39ad6a0c4c2c55e to your computer and use it in GitHub Desktop.
Demonstrate output of elixir code showing grapheme vs codepoints
This file contains hidden or 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
| a = "noël" | |
| IO.puts a | |
| IO.puts String.reverse(a) | |
| IO.puts String.slice(a, 0..2) | |
| IO.puts String.length(a) | |
| b = "😸😾" | |
| IO.puts b | |
| IO.puts String.length(b) | |
| IO.puts String.slice(b, 1..-1) | |
| IO.puts String.reverse(b) | |
| c = "baffle" | |
| IO.puts c | |
| IO.puts String.upcase(c) | |
| d = "noël" | |
| IO.puts d | |
| IO.puts a == d | |
| IO.puts String.equivalent?(a, d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment