Ah thanks!
I also had to remove the $value part. The following works: "Naam".substring(0, "Naam".indexOf(" "))
"Naam".substring(0, "Naam".indexOf(" "))