0

I'm currently making a text editor that reacts to "commands" with a (maybe not professional but) easy and fast if-Statement like the following

    if let quitRange = textView.string!.range(of: "/quit") {
     textField.string!.replaceSubrange(quitRange, with: "")
        NSApplication.shared().terminate(self)
    }

Now I'm wondering how I can get the range of the string with parameters. Something like

 "/encrypt[offSet:21]"

where my offSet Int is completely variable

Ezekiel
  • 91
  • 11

0 Answers0