Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Substring-Top-and-tail/Nim/substring-top-and-tail.nim
Normal file
10
Task/Substring-Top-and-tail/Nim/substring-top-and-tail.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import unicode
|
||||
|
||||
let s = "Hänsel ««: 10,00€"
|
||||
echo "Original: ", s
|
||||
echo "With first character removed: ", s.runeSubStr(1)
|
||||
echo "With last character removed: ", s.runeSubStr(0, s.runeLen - 1)
|
||||
echo "With first and last characters removed: ", s.runeSubStr(1, s.runeLen - 2)
|
||||
# Using the runes type and slices
|
||||
let r = s.toRunes
|
||||
echo "With first and last characters removed (other way): ", r[1 .. ^2]
|
||||
Loading…
Add table
Add a link
Reference in a new issue