html_character_entities 0.0.1 html_character_entities: ^0.0.1 copied to clipboard
A Dart utility class containing a map of key/value pairs for every HTML 4.01 character entity, including ASCII codes, and a method to parse strings for those character entities.
html_character_entities #
A Dart utility class containing a map of key/value pairs for every HTML 4.01 character entity, including ASCII codes, and a method to parse strings for those character entities.
Using #
import 'package:html_character_entities/html_character_entities.dart';
Parsing Strings #
String string = 'An ampersand can be written as & and &.';
print(HtmlCharacterEntities.parse(string)); // An ampersand can be written as & and &.
Map #
final Map<String, String> c = HtmlCharacterEntities.characters;
String string = 'There are 4 suites of cards: ${c['♠']} Spades, ${c['♣']} Clubs, ${c['♥']} Hearts, ${c['♦']} Diamonds';
print(string); // There are 4 suites of cards: ♠ Spades, ♣ Clubs, ♥ Hearts, ♦ Diamonds