CURL url = item.getAsUrl();
url.GetProtocol() == "blah"

No need for that substr nonsense.