c# - execute while block until one of three conditions raises -
i want actions until 1 of following conditions satisfied^
html.indexof("/>")==0
html.indexof("</"+tagname+">")==0
html[0]=='<'
where here html actualy string. have tried - apply or operation inversed conditions. wrong. how properly. here's code:
while((html.indexof("/>")!=0)&&(html.indexof("</"+tagname+">")!=0)||(html[0]!='<')) { html = html.remove(0, 1); }
you mixing , and or reason. have
while(a && b || c)
but want write
while(a && b && c)
the code should read:
while ( (html.indexof("/>")!=0) &&(html.indexof("</"+tagname+">")!=0) &&(html[0]!='<'))
i echo @cdhowie's comment. using html parser make code easier read , write, , make more robust varied input.
Comments
Post a Comment