c# - HTMLDecode string array using LINQ -


How can I use string [] to LINQ Can i

e.g. Instead of string instead of string as Institute & amp; Apos; s from string [] is getting / P>

I tried,

values. ForEach (item = & gt; WebUtility.HtmlDecode (item));

Where My string [] ..

Still, I'm unable to get the desired result.

Edit:

As shown above of my original string, institution and I encode it as I am receiving

Institute & amp; Apos; S ----> First level encoding

Institute & amp; Apos; s ----> Second level encoding

After applying the following solutions, I am able to

Institute

but the actual string Institute

You are not seeing any changes The reason for this is that WebUtility.HtmlDecode does not specify a value for the parameters you passed, instead, giving it the value of the HTML decoded Is there.

  string encoded string = "& amp; amp;"; // This is nothing but WebUtility.HtmlDecode (encoded string); // It assigns a decoded value to a new string string decoded string = WebUtility.HtmlDecode (encoded string);   

Also why (as mentioned in Heinrich) you should use select in your Linux query.

You will use it like this:

  value = value. Select (item => WebUtility.HtmlDecode (item));    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -