Java String Indent Format indentAllLines(String s, String indent)

Here you can find the source of indentAllLines(String s, String indent)

Description

indent All Lines

License

Open Source License

Declaration

public static StringBuilder indentAllLines(String s, String indent) 

Method Source Code

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

Related

  1. indent(StringBuilder builder, int indent)
  2. indent(StringBuilder builder, int times)
  3. indent(StringBuilder sb, int indent)
  4. indent(StringBuilder sb, int indent)
  5. indent2(String text, String indent)
  6. indentation(int howMany)
  7. indentation(int numberOfIndent)
  8. indentationLevel(CharSequence c)
  9. indentationStringOfCursorLine(String text, int cursor)