Use either string.StartsWith() or string.SubString()
VB Code:
string s = "http://w3c.org"; //method 1 if(s.StartsWith("http://")) MessageBox.Show("URI has http://"); else MessageBox.Show("URI don't have http://"); //method 2 s = "http//www.google.org"; if(s.Substring(0,7)=="http://") MessageBox.Show("URI has http://"); else MessageBox.Show("URI don't have http://");




Reply With Quote