Answer:
The answer to this question can be given as:
Method definition :
String getSecondLine (String aString) //define function getSecondLine()
{
return aString.substring(aString.indexOf("\\") + 1, aString.indexOf("\\") + 1 + aString.substring(aString.indexOf("\\") + 1, aString.length()).indexOf("\\"));
//return value.
}
Step-by-step explanation:
The working of the function definition can be given as:
In the above function definition we define getSecondLine() function.
This function returns string value because we use the string return type.
In this getSecondLine() function we pass the a string variable that use substring function which return a string into parts.
In the substring function we use the indexOf function that is used to return the position of the string.
In this method definition, it will return the string value into the new lines.