Here indexOf() is checking every character for you. I don't know of another shortcut - you have to check every character. Unlike C, Java does not normally use nulls to signal the end of a String, and so the libraries don't bother to support it. But it's pretty easy to do yourself.
Thanks Jim I was hopeing there was some util method that would do it but your snippet should do me fine. Bear: It's from an existing file that stores their strings as null terminated, I wouldn't have done it myself that way.