12 lines
349 B
Swift
12 lines
349 B
Swift
|
|
extension String {
|
|
|
|
func htmlEscaped() -> String {
|
|
replacingOccurrences(of: "&", with: "&")
|
|
.replacingOccurrences(of: "\"", with: """)
|
|
.replacingOccurrences(of: "'", with: "'")
|
|
.replacingOccurrences(of: "<", with: "<")
|
|
.replacingOccurrences(of: ">", with: ">")
|
|
}
|
|
}
|