Java add space/char to specific position in string

Java add space/char to specific position in string
refe‮al:ot r‬utturi.com
/**
 * @author lautturi.com
 * Java example: add char in specific position of string
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		String str = "123456789";
		str = str.substring(0, 6) + " " + str.substring(6);
		System.out.println(str);
	}

}

output

123456 789
Created Time:2017-08-30 09:35:36  Author:lautturi