Skip to content

Instantly share code, notes, and snippets.

@girishso
Last active November 4, 2015 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girishso/2c6fb5af9a1ef2fe757f to your computer and use it in GitHub Desktop.
Save girishso/2c6fb5af9a1ef2fe757f to your computer and use it in GitHub Desktop.
funniest code I've seen!
private void processAllHiddenTags(StringBuilder sbXMLString, ASMStudent student)
{
if (((sbXMLString.ToString().IndexOf("<w:body>") >= 0) && (sbXMLString.ToString().IndexOf("<w:body>") <= sbXMLString.Length)) &&
((((sbXMLString.ToString().IndexOf("</w:body>") - sbXMLString.ToString().IndexOf("<w:body>")) + 9) >= 0) &&
(((sbXMLString.ToString().IndexOf("</w:body>") - sbXMLString.ToString().IndexOf("<w:body>")) + 9) <= sbXMLString.Length)))
{
pageText = sbXMLString.ToString().Substring(sbXMLString.ToString().IndexOf("<w:body>"), (sbXMLString.ToString().IndexOf("</w:body>") - sbXMLString.ToString().IndexOf("<w:body>")) + 9).ToString().Trim();
//
// more madness follows!
//
}
}
// apparently the programmer didn't hear about XML parsers!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment