indexOf does not work with a string value?

mistergreen:
substr() is a C++ method. ANy other options?

You could use strncpy().