Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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