java how to split string by length

www.laut‮oc.irut‬m
java how to split string by length
/**
 * @author lautturi.com
 * Java example: split a string by length in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str  = "Hello JavaWorldMysqlPerl ";
		String[] arr = str.split("(?<=\\G.{5})"); 
  
        for (String s : arr) 
            System.out.println(s); 
		
	}
}

output:

Hello
 Java
World
Mysql
Perl
Created Time:2017-09-16 14:05:27  Author:lautturi