tags:

views:

87

answers:

1

Hello,

I was wondering if anyone knows what's up with this html string code:

    <object height=\\\"38\" + \"5\\\" width=\\\"64\" + \"0\\\" classid=\\\"clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000\\\" id=\\\"movie_player\\\" ><param name=\\\"movie\\\" 
value=\\\"http:\\/\\/s.ytimg.com\\/yt\\/swf\\/watch_as3-vfl186120.swf\\\"><param 
name=\\\"flashvars\\\" value=\\\"...." allowscriptaccess=\\\"always\\\" 
allowfullscreen=\\\"true\\\" bgcolor=\\\"#000000\\\" \\/>

It looks horrible... It is embedded in a JavaScript function, to later be rendered to the page. Can anyone tell me how I can clean it using say Html Agility Pack or possibly RegEx although it looks messy!

Important aspect is getting the height=\\\"38\" + \"5\\\" to become height="385" etc. I can get rid of the excesses slashes no problem.

Really appreciate any guidance.

Edit: in the end this is what I used to complete the tags

        objectNodeFormat.Replace(@"\", "");
        objectNodeFormat.Replace(@" + ", "");
        objectNodeFormat.Replace(@"""""", "");

Thanks again.

+1  A: 
tommieb75
Are you sure it's Remove method. It wants an `int` as an index instead of taking the character I want it to remove.
AlexW
I used: `NodeFormat.Replace(@"\\\", "");` instead of Remove in this case. Also used to sort out `"38\" + \"5\\\"` issue I have. Cheers!
AlexW