SyntaxFix
Write A Post
Hire A Developer
Questions
Use a Scanner and pass in the delimiter and the original string:
Scanner
result = new Scanner(result).useDelimiter("\n").next();