Here you can find the source of indent(String in)
public static String indent(String in)
//package com.java2s; //License from project: Open Source License public class Main { public static String indent(String in) { return indent(in, "\t"); }//w ww . j av a 2 s . c o m public static String indent(String in, String indent) { String[] lines = lines(in); for (int l = 0; l < lines.length; l++) lines[l] = indent + lines[l] + "\r\n"; return concatenate(lines); } public static String[] lines(String in) { return in.split("\\r?\\n"); } public static String concatenate(String[] lines) { String ret = ""; for (String line : lines) ret += line; return ret; } }