Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
text = 'Hello, World!'
encoded_text = System.Net.WebUtility.UrlEncode(text)

 # Output: Hello%2C+World%21

...

Code Block
encoded_text = 'Hello%2C+World%21'
decoded_text = System.Net.WebUtility.UrlDecode(encoded_text)

# Output: Hello, World!

...

Code Block
text = '<div>Hello, World!</div>'
encoded_text = System.Net.WebUtility.HtmlEncode(text)

# Output: &lt;div&gt;Hello, World!&lt;/div&gt;

...

Code Block
encoded_text = '&lt;div&gt;Hello, World!&lt;/div&gt;'
decoded_text = System.Net.WebUtility.HtmlDecode(encoded_text)

# Output: <div>Hello, World!</div>

...