Here you can find the source of breakString(String text, int maxsize)
public static String breakString(String text, int maxsize)
//package com.java2s; //License from project: Open Source License public class Main { public static String breakString(String text, int maxsize) { if (text.length() < maxsize) { return text; }// w ww. j av a 2 s. c om return text.substring(0, maxsize) + "\n" + breakString(text.substring(maxsize), maxsize); } }