Check out example codes for "how to cut a certion part from a string in java". It will help you in understanding the concepts better.

Code Example 1

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));

Code Example 2

String str = "manchester united (with nice players)";
System.out.println(str.replace("(with nice players)", ""));
int index = str.indexOf("(");
System.out.println(str.substring(0, index));

Code Example 3

str2=str.substring(begin, [end])

Learn ReactJs, React Native from akashmittal.com