tstring_assignment.nim 347 B

12345678910111213141516171819202122
  1. discard """
  2. output: '''true
  3. asdfasekjkler'''
  4. """
  5. # bug #4471
  6. when true:
  7. let s1 = "123"
  8. var s2 = s1
  9. s2.setLen(0)
  10. # fails - s1.len == 0
  11. echo s1.len == 3
  12. # bug #4470
  13. proc main(s: cstring): string =
  14. result = newString(0)
  15. for i in 0..<s.len:
  16. if s[i] >= 'a' and s[i] <= 'z':
  17. result.add s[i]
  18. echo main("asdfasekjkleräöü")