Skip to content

Instantly share code, notes, and snippets.

@matthewcheok
matthewcheok / Utilities.swift
Last active August 29, 2015 14:23
String Utilities
extension Character {
public static var newlineCharacterSet: Set<Character> {
return ["\u{000A}", "\u{000B}", "\u{000C}", "\u{000D}", "\u{0085}"]
}
public static var whiteSpaceCharacterSet: Set<Character> {
return ["\u{0020}", "\u{0009}"]
}
public static var whiteSpaceAndNewlineCharacterSet: Set<Character> {