I have a string say \"Allentown, pa\"
\"Allentown, pa\"
How to remove the white space in between , and pa using objective c?
,
pa
Hi there is the swift version of the solution with extension :
extension String{ func deleteSpaces() -> String{ return self.stringByReplacingOccurrencesOfString(" ", withString: "") } }
And Just call
(yourString as! String).deleteSpaces()