Skip to content

Instantly share code, notes, and snippets.

@amonshiz
Last active August 29, 2015 14:12
Show Gist options
  • Save amonshiz/e45926df237ede6ec4a5 to your computer and use it in GitHub Desktop.
Save amonshiz/e45926df237ede6ec4a5 to your computer and use it in GitHub Desktop.
let startSplits = split(testText, { $0 == "<" })
let strippedValues = map(startSplits) { (s) -> String? in
if let endIndex = find(s, ">") {
return s[Range<String.Index>(start: endIndex.successor(), end: s.endIndex)]
}
return nil
}
let strings = strippedValues.filter({ $0 != nil }).filter({ $0 != "" }).map({ $0! })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment