Here you can find the source of formatSafetyNumber(String digits)
public static String formatSafetyNumber(String digits)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatSafetyNumber(String digits) { final int partCount = 12; int partSize = digits.length() / partCount; StringBuilder f = new StringBuilder(digits.length() + partCount); for (int i = 0; i < partCount; i++) { f.append(digits, i * partSize, (i * partSize) + partSize).append(" "); }// w w w .j a va 2 s . c o m return f.toString(); } }