Closed xojoc closed 9 months ago
It would be nice to have a String.to_sequence just like we have Array.to_sequence.
String.to_sequence
Array.to_sequence
It could be as simple as the following snippet:
let string_to_sequence s = Sequence.unfold ~init:0 ~f:(fun i -> if i >= String.length s then None else Some (String.get s i, i + 1) )
I could submit a PR if this is wanted.
It would be nice to have a
String.to_sequence
just like we haveArray.to_sequence
.It could be as simple as the following snippet:
I could submit a PR if this is wanted.