Answers for "how to cut peace of string in java"

0

how to cut a certion part from a string in java

int startIndex = str.indexOf("(");
int endIndex = str.indexOf(")");
String replacement = "I AM JUST A REPLACEMENT";
String toBeReplaced = str.substring(startIndex + 1, endIndex);
System.out.println(str.replace(toBeReplaced, replacement));
Posted by: Guest on June-24-2020
0

how to cut a certion part from a string in java

str2=str.substring(begin, [end])
Posted by: Guest on June-24-2020

Code answers related to "how to cut peace of string in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language