diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-01-13 14:34:24 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-01-13 14:34:24 -0800 |
commit | 90721375e2e92763c24193960b686d143aa2b091 (patch) | |
tree | f44a902c40f35937f045ef14536921020fe17b3f | |
parent | 1e4c4d62e4d4ccda50d657fbd761da36a462f00d (diff) | |
parent | 40bd63f83b045ab88c2da232d4848566aa5008ca (diff) | |
download | Nim-90721375e2e92763c24193960b686d143aa2b091.tar.gz |
Merge pull request #779 from brihat/master
Define $ operator for TRune
-rw-r--r-- | lib/pure/unicode.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 4aacb2f71..f90fc2745 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -132,6 +132,10 @@ proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} = result = newString(1) result[0] = chr(i) +proc `$`*(rune: TRune): string = + ## converts a rune to a string + rune.toUTF8 + proc `$`*(runes: seq[TRune]): string = ## converts a sequence of runes to a string result = "" |