Try the following:
Function UrlStartsWith(string1, string2) UrlStartsWith = InStr(1, string1, string2, 1) = 1 End Function If UrlStartsWith(rs("mainVideoName"), "http://www.youtube.com") Then End If
Starting with is checked using IntStr and ensuring that it returns 1 as the starting position at which the search string is found. Since you are testing the URL, the code above uses TextCompare to provide case insensitivity.
AnthonyWJones
source share