Return to site

Java text block guideline 7

· java

Either use only spaces or only tabs for the indentation of a text block. Mixing white space will lead to a result with irregular indentation.

//ORIGINAL
    String colors = """
········red
␉       green
········blue""";
//result: "·······red\ngreen\n·······blue"

//PROBABLY WHAT WAS INTENDED
    String colors = """
········red
········green
········blue""";
//result: "red\ngreen\nblue"