1

I am getting a string "lb/in&sup2" (which I want to show as lb/in²) from server. I want to decode this and show it in my Xamarin.iOS app.

I tried:

System.Net.WebUtility.HtmlDecode("lb/in&sup2")

but its not working, still shows as "lb/in&sup2".

1 Answer 1

1

Html entity should end with ";" character. This should work fine:

System.Net.WebUtility.HtmlDecode("lb/in²");

If you are getting string exactly as you posted - you should fix the side which you are getting this string from, because "&sup2" is not html entity, it's just a "&sup2" string.

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

1 Comment

Thank you. Looks like I've to fix it from the server side.

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.