[Solved] Replace string between characters in swift
A simple regular expression: let sentence = “This is \”table\”. There is an \”apple\” on the \”table\”” let pattern = “\”[^\”]+\”” //everything between ” and ” let replacement = “____” let newSentence = sentence.replacingOccurrences( of: pattern, with: replacement, options: .regularExpression ) print(newSentence) // This is ____. There is an ____ on the ____ If you … Read more