-3

i have a string of html:

 "<!DOCTYPE html PUBLIC ......"

or

"<body> ..........</body>"

I want to check if my string starts with "<!DOCTYPE".

Thanks in advance!

Giannis Grivas
  • 3,284
  • 1
  • 15
  • 37

2 Answers2

4

from the problem you describe a simple string StartsWith should do the trick http://www.dotnetperls.com/startswith

Moshe Eshel
  • 658
  • 7
  • 19
3

Just use .StartsWith against your string object.

http://msdn.microsoft.com/en-us/library/baketfxw(v=vs.110).aspx

kidshaw
  • 3,221
  • 2
  • 14
  • 25