-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,374
  • 1
  • 18
  • 38

2 Answers2

4

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

Moshe Eshel
  • 708
  • 7
  • 19
3

Just use .StartsWith against your string object.

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

kidshaw
  • 3,423
  • 2
  • 16
  • 28