I get the number from a matrix contacts ,which each one have a number of the persone, however my problem is that I want the number in raw in order to I can match with another matrix.
for a in contacts
{
let content: String = a.phone
let result1 = content.stringByReplacingOccurrencesOfString("(", withString:"")
let result2 = result1.stringByReplacingOccurrencesOfString(")", withString:"")
let result3 = result2.stringByReplacingOccurrencesOfString("-", withString:"")
let result4 = result3.replace(" ", replacement: "")
println(result4)
// newNames.append(result4)
//contador=contador+1
}
//result[555 555,999 3188,999 1]
so is not eliminate the spaces why?, why if the other conditions worked well, I also use the:
let result4 = result3.stringByReplacingOccurrencesOfString(" ", withString: "")
and it does not work why?
//result[555 555,999 3188,999 1]