K
K
Kirill Petrov2014-01-11 16:31:26
Java
Kirill Petrov, 2014-01-11 16:31:26

Java how to remove part of string {...}?

I know, the question is generally stupid, but I don’t understand something yet ...
There is a string like:
I am a string, I am just a string, {you are not just a string}I want to get rid of the curly braces {do not get rid of us :( }.
How can I process this line in java to remove the contents of the curly braces and the braces themselves?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dr_yand, 2014-01-11
@Recosh

String s = "abc{hi}df".replaceAll("\\{.*\\}", "");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question