Substringing in swift feels so complicated
I want to get
abc
from
word(abc)
What is the easiest way of doing this?
And how can i fix the below code to work?
let str = "word(abc)"
// get index of (
let start = str.rangeOfString("(")
// get index of )
let end = str.rangeOfString(")")
// substring between ( and )
let substring = str[advance(str.startIndex, start!.startIndex), advance(str.startIndex, end!.startIndex)]