About 9,940,000 results
Open links in new tab
  1. Java String Class indent () Method With Examples

    Apr 13, 2021 · JDK 12 introduced indent () method in Java.lang.String class. This method is useful to add or remove white spaces from the beginning of the line to adjust indentation for …

  2. How to indent in Java using format - Stack Overflow

    Jan 16, 2019 · public static String indent(String text, int indent) { // Java 11: `var whitespace = " ".repeat(indent);` var whitespace = String.format("%" + indent + "s", " "); return whitespace + …

  3. Java String indent() Method - Java Guides

    The String.indent() method in Java is used to adjust the indentation of each line in a string. This guide will cover the method's usage and examples.

  4. Java String indent() Method Examples

    Jul 29, 2019 · Java String indent () method is used to indent every line in the string and normalize the newline characters. This method was added to String class in Java 12 release. The string …

  5. Java’s String.indent () Method Explained - Medium

    Dec 3, 2024 · Learn about Java's String.indent() method, introduced in Java 12, to adjust line indentation, format logs, and make text outputs more readable with examples.

  6. Java 12 String API indent () Method Example - JavaProgramTo.com

    May 27, 2019 · A Quick Guide to java.lang.String indent () method introduced in Java 12 version as part of JDK 12. Indent() method indents the string by give number of white spaces at left …

  7. Java String indent () Method Example - Source Code Examples

    The String.indent () method, introduced in Java 12, adjusts the indentation of each line of the calling string according to the specified number of spaces. It can be used to increase or …

  8. Java String Indent () Method - Know Program

    The syntax of the String indent() method is as follows:-public String indent(int n) Parameter:- takes integer parameter n as input and does the indentation. Return type:- string Returns:- string …

  9. String.indent() – Left Indent a Line in Java - HowToDoInJava

    Jan 9, 2024 · Learn to indent (left indentation) a multi-line string in Java using String.indent() API. This api has been introduced in Java 12.

  10. printf - Indented print in java - Stack Overflow

    Nov 8, 2015 · How do I get it to print everything equally indented, so my output would be : Author : author . Title : title . Pages : 0. Thank you. Or you could just add the needed spaces to your …

  11. Some results have been removed
Refresh