Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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

how to cut a certion part from a string in java

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

how to cut a certion part from a string in java

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

PREVIOUS NEXT
Code Example
Java :: java nom de la methode actuel 
Java :: find if element is powers of 2 
Java :: printing array in descending order 
Java :: spring boot thymeleaf bindingresult 
Java :: interview questions on ds and algo 
Java :: android string animation 
Java :: os compatible java path separator 
Java :: Kotlin const to Java 
Java :: code for working clock in java eclipse 
Java :: sort a list according to location 
Java :: how to make more than one jlabel at once in java 
Java :: localdatetimw java input 
Java :: media style dependency androidx 
Java :: write arraylist to outputstream java byte file 
Java :: sorted hashmap java 
Java :: get whatsapp group id flutter 
Java :: reader java 
Java :: how to apply validation on aiphanumeric series starting with 4 characters with 4 letters in java 
Java :: java.lang.stackoverflowerror null onetomany 
Java :: Java Creating WeakHashMap from Other Maps 
Java :: advantages of iterator in java 
Java :: Arraylist imp for recursion 
Java :: android edittext with icon 
Java :: open application programelly android studio 
Java :: firebase timestamp to textview 
Java :: Java Integer Literals 
Java :: Sample TreeMap 
Java :: custom validator arrays 
Java :: java matrix return a weird string 
Java :: java boolean zen 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =