By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,769 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,769 IT Pros & Developers. It's quick & easy.

string parser

P: n/a
hi Im using a ravsoft string passer class and I get errors with;
string strQuote = "";
string str = "..."; // HTML
StringParser p = new StringParser (str);
if (p.skipToEndOfNoCase ("<td><span
class="GlobalBoldedText">") &&
p.extractTo ("</td>", ref strQuote));
Console.WriteLine ("MSFT (delayed) = {0}", strQuote);

}
Where "GlobalBoldedText" is, its underlined and it wants ), the end
brackets is invalid expression ter. If i remove the "" around
GlobalBoldedTex then it will complie, but then it wont find the string.
Any Ideas.
Regards Robert

May 16 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I don't know anything about that stringparser, but it looks like the
quotes are fouling you up. Try escaping the quotes around
GlobalBoldedText like this:

if (p.skipToEndOfNoCase("<td><span class=\"GlobalBoldedText\">") ....

and see if that helps.

May 16 '06 #2

P: n/a
Thamks for you reply, that got rid of the errors. So its to do with the
quotes, problem is, it wont parse the info because \ are not in the
original HTML. At least ive an idea of were to look.
Regards Robert

May 16 '06 #3

P: n/a
"Ro********@yahoo.co.uk" <Ro********@yahoo.co.uk> wrote:
if (p.skipToEndOfNoCase ("<td><span
class="GlobalBoldedText">") &&


Use '\' to escape " inside a string:

if (p.skipToEndOfNoCase ("<td><span
class=\"GlobalBoldedText\">") &&
-- Barry
May 16 '06 #4

P: n/a
The \ will not be included in the final string, they just escape the
quotation marks. The final string should only have the quotation marks.

May 16 '06 #5

P: n/a
Thankd Chris. I think its how Im parsing the html. The lines there but
cant get to it.
Regards Robert

May 16 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.