RosettaCodeData/Task/Substring-Top-and-tail/Nim/substring-top-and-tail.nim

10 lines
193 B
Nim
Raw Permalink Normal View History

2020-02-17 23:21:07 -08:00
import unicode
let s = "Hänsel ««: 10,00€"
echo(s.runeSubStr(1))
echo(s.runeSubStr(0, -1))
echo(s.runeSubStr(1, -1))
# using the runes type and slices
let r = s.toRunes
echo(r[1 .. ^2])