vuyisile.github.io

View on GitHub
6 November 2017

Converting To Html Entities

by {"name"=>"Vuyisile Weni"}

Converting to Html entities

Overview about html entities.

According to MDN Entitie, an HTML entity is a piece of text (“string”) that begins with an ampersand (&) and ends with a semicolon (;) . Entities are frequently used to display reserved characters (which would otherwise be interpreted as HTML code), and invisible characters (like non-breaking spaces). You can also use them in place of other characters that are difficult to type with a standard keyboard.

Instruction

Convert the characters &, <, >, “ (double quote), and ‘ (apostrophe), in a string to their corresponding HTML entities.

My approach

tags: