KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Have following Java code,that creates StringBuilder with "\n",i.e. carriage return delimiters: while (scanner.hasNextLine()){ sb.append(scanner.nextLine()).append("\n"); } It's occurred,that after last String(line) had "\n" symbol. How to gracefully remove last "\n" from resulting StringBuilder object? thanks.
Tags (comma-separated)
Save Edits
Cancel