I'm trying to 'group' a string into segments, I guess this example would explain it more succintly scala> val str: String = "aaaabbcddeeeeeeffg" ... (do something) res0: List("aaaa","bb","c","dd","eeeee","ff","g") I can thnk of a few ways to do this in an imperative style (with vars and stepping through the string to find groups) but I was wondering if any better functional solution could be attai

