How to split an large string to two different arrays : I'm working on a app where the user creates a large string containing consisting a and b.Now I want to split the character a to one array or string and b to another array or string.And convert them to its original form when needed.

What I'm trying to achieve is

String:abbabbaabbab.
array1:{a,a,a,a,a},
array2:{b,b,b,b,b,b}.