diff options
author | Satish BD <bdsatish@gmail.com> | 2013-12-26 00:40:50 +0200 |
---|---|---|
committer | Satish BD <bdsatish@gmail.com> | 2013-12-26 00:41:43 +0200 |
commit | 69b816f07c78ab8e672eaa926e9bd3e28c6ff658 (patch) | |
tree | af168845682269a939f326f98d26596a6b18aa90 | |
parent | 033938a53a62399d45c5fd6fe9c4e798431c964f (diff) | |
download | Nim-69b816f07c78ab8e672eaa926e9bd3e28c6ff658.tar.gz |
Define $ operator for TRune
-rw-r--r-- | lib/pure/unicode.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 4aacb2f71..0d5b06c92 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -132,6 +132,8 @@ proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} = result = newString(1) result[0] = chr(i) +proc `$`*(rune: TRune): string = rune.toUTF8 + proc `$`*(runes: seq[TRune]): string = ## converts a sequence of runes to a string result = "" |