![]() |
In Java, String Plays an important role. As String stores or we can say it is a collection of characters. We want to get a specific line from a multi-line String in Java. This can also be done in Java. In this article, we will be learning how to extract a specific line from a multi-line String in Java using extractLine() method.
Program to Extract a Specific Line from a Multi-Line String in JavaBelow is the implementation of extracting a specific line from a multiline string by using extractLine() and split() methods. Java
Output
Original String is : She is a very good girl Also, she is very intelligent. She got the first prize. She will definitely make her parents proud. The Specific line is : She got the first prize. Explanation of the Program:
|
Reffered: https://www.geeksforgeeks.org
Java |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 14 |