subject

Write a method, getFirstLine, that is passed a String argument and that returns the first line. (Recall that lines are terminated with the "\n" character.) Assume that the argument contains at least one complete, newline-terminated line. My Solution:
public String getFirstLine(String a)
{
String[] myLines = a. split("\n");
return(myLines[0]);
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
To move an excel worksheet tab, simply right-click on it drag and drop it double-click on it delete it
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Who introduced the concept of combining artificial and natural light in the studio
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
What is the next step if your volume does not work on computer
Answers: 2
You know the right answer?
Write a method, getFirstLine, that is passed a String argument and that returns the first line. (Rec...
Questions
question
Mathematics, 14.09.2020 18:01
question
Mathematics, 14.09.2020 18:01
question
Social Studies, 14.09.2020 18:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
English, 14.09.2020 19:01
question
Biology, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
English, 14.09.2020 19:01
question
Social Studies, 14.09.2020 19:01
question
Business, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Social Studies, 14.09.2020 19:01
question
English, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01