Reputation: 2295
My application is MVC5, I get a string value from a dropdownlist, the item value is <20%.
If I try to append another string with the value of the item it cuts it.
for example:
string itemvalue = x; /*item value from the dropdownlist*/
string totalvalue = "score" + x;
on debug, the total value = score <20%. However when I print it using itextsharp HTMLWorker I only get score!
Upvotes: 0
Views: 182
Reputation: 444
the <
is an html tag. you can replace it with <
string itemvalue = x; /*item value from the dropdownlist*/
string totalvalue = "score" + x;
totalvalue.Replace("<","<");
// you can use it now! ;)
other things:
>
should be >
refer to http://www.w3schools.com/html/html_entities.asp
Upvotes: 1
Reputation: 11324
I think using this will solve your issue
string itemvalue = x; /*item value from the dropdownlist*/
string totalvalue = String.Format( "score{0}",x);
Why not this
remove %
from String
String.Format( "score{0}%",x);
String.Format( "score{0:00%}",x);
Upvotes: 0