View difference between Paste ID: Hr4U9Ct9 and VxiFPKgc
SHOW: | | - or go back to the newest paste.
1
template cutRight(s: string, charsToCut: int): typed = 
2
    s[0..^(charsToCut + 1)]
3
4-
echo cutRight("Hello World", 6)
4+
echo cutRight("Hello World", 6)
5
6
#[
7
>nim c -r strslice.nim
8
Hint: used config file 'C:\Program Files\Nim\config\nim.cfg' [Conf]
9
Hint: used config file 'C:\Users\Fredrik\AppData\Roaming\nim.cfg' [Conf]
10
Hint: system [Processing]
11
Hint: strslice [Processing]
12
strslice.nim(4, 14) template/generic instantiation from here
13
strslice.nim(2, 8) template/generic instantiation from here
14
lib\system.nim(3764, 8) Error: no surrounding array access context for '^'
15
]#