// // File.swift // // // Created by Juraldinio on 01.08.2022. // import Foundation public extension String { func trimCompact() -> String { let value = self .replacingOccurrences(of: "\n", with: "") .replacingOccurrences(of: "\r", with: "") let regex = try! NSRegularExpression(pattern: "[ ]{2,}", options: .caseInsensitive) return regex.stringByReplacingMatches(in: value, options: [], range: NSRange(0..