Answer the question
In order to leave comments, you need to log in
JAVA. How to put one parenthesis in a String?
Hello. I need to split the String exactly when the parenthesis opens.
String str = word(blabla);
I want to split the text starting from the first parenthesis and then remove the last parenthesis from substring to get only blabla from this text.
String[] pieces = str.split("(") - you can't do that unfortunately(
and then I wanted to do this:
String a = pieces[1].substring(0,pieces[1].lenght()-1)
The result should be: blabla.How
can I get blabla out of the brackets if I can't do it with split?
PS the length of word and blabla can be different
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question