Tuesday, 28 May 2013

How to split string into array of three characters

How to split string into array of three characters

I have the string data like
Aabc123def457ghi123jkl950asd489are
AB950asd489are
ABC950asd489are
and I want to split those into array of string like this
[A,abc,123,def,457,ghi,123,jkl,950,asd,489,are]
[AB,950,asd,489,are]
[ABC,950,asd,489,are]
Just like a currency formatter with comma , and split it into array. I need to find a regex for that, or is there any way to do that?

No comments:

Post a Comment