RosettaCodeData/Task/String-length/Nim/string-length-2.nim
2016-12-05 23:44:36 +01:00

6 lines
164 B
Nim

import unicode
var s: string = "Hello, world! ☺"
echo '"',s, '"'," has unicode char length: ", runeLen(s)
# -> "Hello, world! ☺" has unicode char length: 15