I have a string (e.g. "AABBCCDDEEFF") and want to split this into an array with each element containing two characters - ["AA", "BB", "CC", "DD", "EE", "FF"].
Try the String object's scan method:
>> foo = "AABBCCDDEEFF" => "AABBCCDDEEFF" >> foo.scan(/../) => ["AA", "BB", "CC", "DD", "EE", "FF"]
1.4m articles
1.4m replys
5 comments
57.0k users