I have a chunk of code that looks like this: HiClass *myNewClass;
Now, what I'm doing is writing a method to roll through and delete the Hi, as well as everything after it, including the *, so that only myNewClass; is left. Now, I take out the "Hi" like so:
textToConvert = inputField.stringValue.stringByReplacingOccurrencesOfString("Hi", withString: "", options: NSStringCompareOptions.LiteralSearch, range: nil) But within this same method, if possible, I would like to somehow delete everything leaving only myNewClass;, as stated above.
My first though on how to approach this is to use a range. Though still being new to Swift and trying to avoid Objective-C, I'm unsure of how to remove all of the characters between the Hi and the *, leaving onlymyClass.