Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> but isn't it giving up too much to disallow null characters in the middle of a string?

You can have null characters in the middle of strings:

  var s = "foo"
  s[1] = '\0'
  echo len(s)
  echo s[2]
Nim will always append a null character to a string for when it gets passed to a C function, but Nim's string functions work just fine with the string proper containing null characters also.


Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: