Answers for "remove n from string java"

0

remove new line in string of java

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

remove all new line and other in string using java

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

remove part of string java

// Works only if you have a certain character at which you want to cut
String text = "Image.png";

String[] cutText = text.split("\\.");

// cutText[0] has value "Image"
// cutText[1] has value "png"
Posted by: Guest on March-11-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language