Skip to content

Instantly share code, notes, and snippets.

@wiwi-git
Created November 25, 2020 07:42
Show Gist options
  • Save wiwi-git/0ea6461fc684873320f5f87e81597259 to your computer and use it in GitHub Desktop.
Save wiwi-git/0ea6461fc684873320f5f87e81597259 to your computer and use it in GitHub Desktop.
if let range0 = text.range(of: "다라") {
let startWord = text[range0].startIndex
let endWord = text[range0].endIndex
let w0 = text[text.startIndex ..< startWord]
let w1 = text[startWord ..< endWord]
let w2 = text[endWord ..< text.endIndex]
print("\(w0)\n\(w1)\n\(w2)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment