i want to extract a word from a string something like this:
"{"photo" : "95.png",
"other_name" : "othername",
"name" : "Painting",
"services" : [],
"_id" : "id"}"
no i want to extract the value of name:
from here how do i do that,
so it would be like any text the comes after "name" : "
is the word i am looking for
i tried something like this
let index = onlyName.index(onlyName.index(of: "\"name\"") ?? onlyName.startIndex, offsetBy: 10)
let mySubstring = onlyName[..<index]
based on this question but onlyName.index(of: "\"name\"")
is giving me null
i know i could just convert it to a json that will be easier but needs to be a string
so how can i get the value of the name,it could be using regx