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.

1 Answer 1

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() ?)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. It works. I am working with PubMed API, that's how they format some of the data unfortunately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.