my question is if it is possible in Swift to count how many characters are located in a string.
For example I have the following string:
"100,101,305,222"
Now I want to know how many commas are in this string? Is it possible to find out in Swift?
"100,101,305,222"
.filter { $0 == "," }
.count