group package:text

O(n) Group characters in a string by equality.
The group function takes a Text and returns a list of Texts such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test.
O(n) Group characters in a string according to a predicate.
The groupBy function is the non-overloaded version of group.