About 16,100,000 results
Open links in new tab
  1. java - Read String line by line - Stack Overflow

    Jul 8, 2009 · Given a string that isn't too long, what is the best way to read it line by line? I know you can do: BufferedReader reader = new BufferedReader(new StringReader(<string>)); …

  2. Java String Class lines() Method with Examples - GeeksforGeeks

    Feb 3, 2022 · The readLine() method of Console class in Java is used to read a single line of text from the console. Syntax: public String readLine() Parameters: This method does not accept …

  3. What is the best way to iterate over the lines of a Java String?

    Feb 13, 2012 · BufferedReader has a method readLine() so you can read your string line by line. StringReader reader = new StringReader(myBigTextString); BufferedReader br = new …

  4. Console readLine () method in Java with Examples

    Jun 12, 2020 · The readLine(String, Object) method of Console class in Java is used to read a single line of text from the console by providing a formatted prompt. Syntax: public String …

  5. io - How to use readline () method in Java? - Stack Overflow

    Dec 19, 2011 · BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in)); String line=buffer.readLine(); Or use java.util.Scanner class methods. Scanner scan=new …

  6. Java User Input (Scanner class) - W3Schools

    To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. In our example, we will use the nextLine() method, …

  7. How to Read a Line of Text Including Line Terminators from an …

    To read lines of text from an input stream in Java while preserving the line termination characters, you typically utilize the `BufferedReader` class and customize the reading process to append …

  8. BufferedReader readLine() method in Java with Examples

    May 28, 2020 · The readLine() method of BufferedReader class in Java is used to read one line text at a time. The end of a line is to be understood by '\n' or '\r' or EOF. Syntax: public String …

  9. How to Read a String Line by Line in Java? - CodingTechRoom

    Discover efficient methods to read a string line by line in Java, including code examples and best practices.

  10. How to Use the Java readLine() Method? - JavaBeat

    Jan 30, 2024 · The readLine() method in Java reads only one line from the given input sources. For this, the user can import different public classes from the “java.io” package such as …

  11. Some results have been removed
Refresh