RosettaCodeData/Task/String-length/Nim/string-length-2.nim

7 lines
164 B
Nim
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
import unicode
var s: string = "Hello, world! ☺"
echo '"',s, '"'," has unicode char length: ", runeLen(s)
# -> "Hello, world! ☺" has unicode char length: 15