Skip to content

Instantly share code, notes, and snippets.

View nathanfjohnson's full-sized avatar

nat_a_cyborg nathanfjohnson

  • 18:47 (UTC -05:00)
View GitHub Profile
@nathanfjohnson
nathanfjohnson / String+HTML.swift
Last active November 23, 2021 15:09 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift 4
// Swift 4
// Check out the history for contributions and acknowledgements.
extension String {
/// Returns a new string made by replacing all HTML character entity references with the corresponding character.
///
/// - Returns: decoded string
func decodingHTMLEntities() -> String {
var result = String()
var position = startIndex