title: How to decode special character or HTML entities in react native or JS?
body: <p>I am getting String from backend which has HTML entities. </p>
  
  <p><code>&amp;#8216;</code> <code>&amp;#8217;</code> <code>&amp;#8220;</code> <code>&amp;#8221;</code> which are <code>‘</code> <code>’</code> <code>“</code> <code>”</code> respectivley.</p>
  
  <p>I have used different function such as :-</p>
  
  <pre><code>var map = { amp: '&amp;', lt: '&lt;', gt: '&gt;', quot: '"', '#039': "'"};
  
  var output = newsTitle.replace(/&amp;([^;]+);/g, (m, c) =&gt; map[c]);
  </code></pre>
  
  <p>output is the parsed string but it is not able to replace the in <strong><em>JavaScript</em></strong> or <strong><em>React Native</em></strong>. Any help would be appreciated.</p>
  
  <p><strong>Edit:-</strong></p>
  
  <p>I am actually passing this text in </p>
  
  <pre><code>&lt;Text numberOfLines={2}&gt;
  {output}
   &lt;/Text&gt;
  </code></pre>