Java String Break breakString(String text, int maxsize)

Here you can find the source of breakString(String text, int maxsize)

Description

break String

License

Open Source License

Declaration

public static String breakString(String text, int maxsize) 

Method Source Code

//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);
    }
}

Related

  1. breakString(String input, int partLength)
  2. breakString(String remainingStr, String soFar, int maxLineLength)
  3. breakString(String str, int maxLineLenght)
  4. breakString(String string, int l, String newLine)
  5. breakString(String theString)