Advertisement
Guest User

strslice.nim

a guest
Jun 28th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template cutRight(s: string, charsToCut: int): typed =
  2.     s[0..^(charsToCut + 1)]
  3.  
  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. ]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement