mirror of
https://github.com/yattee/yattee.git
synced 2024-11-12 17:18:22 +00:00
12 lines
321 B
Swift
12 lines
321 B
Swift
import Foundation
|
|
|
|
extension String {
|
|
var serializationSafe: String {
|
|
let serializationUnsafe = ":;"
|
|
let forbidden = CharacterSet(charactersIn: serializationUnsafe)
|
|
let result = unicodeScalars.filter { !forbidden.contains($0) }
|
|
|
|
return String(String.UnicodeScalarView(result))
|
|
}
|
|
}
|