I'm using this to find the number of occurrences in a character of a string
String(appWindow.title.count - appWindow.title.replacingOccurrences(of: "x", with: String()).count)
Is there a way to do it with a simpler command?
I tried to split it but it always says 1 even when the char isn't there.