2
다음과 같은 문자열이 있습니다 : 56f7gg5cx887r7gt8r6t7
.2 개의 쌍을 포함하는 배열로 문자열을 분할
하나의 배열로 분할 한 다음 두 개의 루프로 반복하고 두 개씩 들어있는 항목으로 다른 배열을 만듭니다.
더 간단한 방법이 있습니까?
결과는 ['56','f7','gg','5c','x8','87','r7','gt','8r','6t','7']
이어야합니다.
왜 이렇게할까요? – stackErr
참조 : http://stackoverflow.com/questions/6259515/javascript-elegant-way-to-split-string-into-segments-n-characters-long – Intelekshual
[XY 문제]의 경우처럼 들리므로 http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). –