replace(src:String, dst:String)
but you have weird
stringByReplacingOccurrencesOfString(src, withString: dest, options: NSStringCompareOptions(), range: nil)
Why not to have simple convenience method?
replace(src:String, dst:String)
but you have weird
stringByReplacingOccurrencesOfString(src, withString: dest, options: NSStringCompareOptions(), range: nil)
Why not to have simple convenience method?
void A::replace(const A& source, const A& dest);
vs
A A::replace(const A& source, const A& dest) const;
That said, I think you can get this same benefit without such a verbose name. Perhaps something like "withReplacement"?
The compiler implementation could use mutability behind the scenes for efficiency, while the language exclusively allowed immutable values.
This is why I was careful to say that Swift's API is the best in terms of its fundamental design. It still has a lot of missing functionality compared to other languages right now.