Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • How can this be easily ported to C ? Commented Jan 19, 2013 at 21:52
  • @user1663901 Change the last character before the null byte to a null byte itself: stackoverflow.com/a/1726318/824544 s[strlen(s)-1] = 0; Commented Jan 19, 2013 at 22:17

lang-py