Answer the question
In order to leave comments, you need to log in
How to trim a string in Java?
Everything! I've decided everything!
The solution was simple... as always:
String[] tmp = jEditorPane2.getText().split("\\?", 2);
jEditorPane2.setText(tmp[0]);
Answer the question
In order to leave comments, you need to log in
I decided everything myself. Fast and easy as it turns out:
String[] tmp = jEditorPane2.getText().split("\\?", 2);
jEditorPane2.setText(tmp[0]);
String str1 = "toster.ru?abrakadabra....";
String str2 = str1.split("\\?")[0];
System.out.println(str2); //toster.ru
Read what is in the exception and fix or handle this exception.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question