Answers for "java remove newline from end of string"

0

remove new line in string of java

String text = "line 1nnline 3nnnline 5";
String adjusted = text.replaceAll("(?m)^[ t]*r?n", "");
Posted by: Guest on October-07-2021
1

remove spaces at beginning and end of string java

String withSpaces = "  Hi  ";
String withoutSpaces = withSpaces.trim();
Posted by: Guest on May-12-2020
0

remove all new line and other in string using java

// #5
text = text.replaceAll("\R", " ");
Posted by: Guest on October-07-2021

Code answers related to "java remove newline from end of string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language