Skip to content

Instantly share code, notes, and snippets.

@fredreichbier
Created August 19, 2013 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredreichbier/6275351 to your computer and use it in GitHub Desktop.
Save fredreichbier/6275351 to your computer and use it in GitHub Desktop.
Some strange behaviour with zero-length strings
import text/StringTokenizer
"1) " split(".") get(0) println()
"2) %s" printfln("" split(".") get(0))
// prints:
// 1)
// 2) (nil)
"hi! %s" printfln(String new("" as CString, 0))
// prints: hi! (nil)
// shouldn't that be: hi!
// ...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment