I need to split a string into 2-letter pieces. Like “friend\" -> \"fr\" \"ie\" \"nd\". (Okay, its a step for me to change HEX string to Uint8 Array)
My code is
Another option just for fun:
extension String { var pairs:[String] { var result:[String] = [] let chars = Array(characters) for index in 0.stride(to: chars.count, by: 2) { result.append(String(chars[index..