Check if string is a URL?

I also use indexOf split creates a array and you don't need a array for this :)

Well, you cannot say that… if you want to check the validity of an url indexOf isn’t enough…

If you have for example only “http://” with the split it will never verify the length > 1 while with the indexOf it will consider it a correct link in both cases

== 0 or >-1