Here you can find the source of indentAllLines(String s, String indent)
public static StringBuilder indentAllLines(String s, String indent)
//package com.java2s; public class Main { public static StringBuilder indentAllLines(String s, String indent) { StringBuilder sb = new StringBuilder(); String delimiter = ""; for (String line : s.split("\n")) { sb.append(delimiter).append(indent).append(line); delimiter = "\n"; }//from w w w . j ava 2 s. com return sb; } }