“Jak wyciąć część certion ze sznurka w Javie” Kod odpowiedzi

Jak wyciąć część certion ze sznurka w Javie

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));
Angry Albatross (Old)

Jak wyciąć część certion ze sznurka w Javie

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));
Angry Albatross (Old)

Jak wyciąć część certion ze sznurka w Javie

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

Odpowiedzi podobne do “Jak wyciąć część certion ze sznurka w Javie”

Pytania podobne do “Jak wyciąć część certion ze sznurka w Javie”

Więcej pokrewnych odpowiedzi na “Jak wyciąć część certion ze sznurka w Javie” w Java

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu