Matching prefixes in Swift strings

How do you determine if one string starts with another, in Swift? Surely that’s exactly what the hasPrefix(_:) method is for: No can haz etiquette? Wot? The problem is that hasPrefix is not meant for general use with human text; it’s barely better than a byte-wise comparison. It only guarantees that it won’t be fooled… Read more

Flinging poo in Swift

Thanks to one of the genuine upsides of Swift, full Unicode support in the compiler itself, you can do: Finally you can express yourself honestly within your program: Or, if you prefer to be polite & British about it: You can go further, if you like, and have all manner of interesting things thrown about… Read more