0

My string is:

 string title = "CaSiO<sub>3</sub> perovskite in diamond indicates the recycling of oceanic crust into the lower mantle."

I used @Html.Raw(title) and got

CaSiO<sub>3</sub> perovskite in diamond indicates the recycling of oceanic crust into the lower mantle.

How do I print it in view as:

CaSiO3 perovskite in diamond indicates the recycling of oceanic crust into the lower mantle.

user2109581
  • 187
  • 2
  • 2
  • 11

1 Answers1

2

@Html.Raw(WebUtility.HtmlDecode(title)) will display the string in the format you want.

(But why is the string defined in that way in the first place? Why not define it with <sub></sub> and then just use @Html.Raw() ?)

RickL
  • 3,318
  • 10
  • 38
  • 39