My problem is when i try to add a url to a link, an extra " is always appended at the end of the string.
Current faulty code :
Label add_url = "<a href=\"/test/\">link</a>"; // produces link pointing to /test/
Label rep_url = add_url.Replace("\"/", "http://mysite.com/"); // produces a faulty link which points to http://mysite.com/test/" <- NOTE! EXTRA " HERE
Am i missing something? please help.
You probably missed the open quote, since you are replacing it:
Label rep_url = add_url.Replace("\"/", "\"http://mysite.com/");
The trailing quote is fine, it should be there. It's the one after the equal sign that is missing.
The imbalance of quotes happens because you are removing the initial quote, not because you are inserting a trailing one:
Label rep_url = add_url.Replace("\"/", "\"http://mysite.com/");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With