Some url strings in backend response is url encoded, while some are not. How to pick out those not encoded?
Updated:
Given that there are three kind of strings:
valid url string, url-encoded;
valid url string, original(not url-encoded);
invalid url string.
What I wanna do is creating URL
from the first two kinds of strings.
With those in first kind, I'll just call init?(string:)
.
With those in second kind, I'll have to encode them before calling init?(string:)
So how to efficiently and elegantly create URL
instances from those strings?