4
I have a String as in the example below
String a = "Meu pai é um Grande "baio" de fada";
I want to make it a string like this
String a = "Meu pai é um Grande \"baio\" de fada";
how do I do this using replaceAll?
4
I have a String as in the example below
String a = "Meu pai é um Grande "baio" de fada";
I want to make it a string like this
String a = "Meu pai é um Grande \"baio\" de fada";
how do I do this using replaceAll?
6
It would be something like:
String a = "Meu pai é um Grande "baio" de fada";
a = a.replaceAll("\"", "\\\"");
In this case will exchange any quotes found, regardless if it is "test
or "test"
.
But your question seems to me that it is more with Regex, the use I believe that is this:
String a = "Meu pai é um Grande "baio" de fada";
a = a.replaceAll("\"([^\"]+)\"", "\"$1\"");
In this case you will find everyone inside the quotation marks, for example "?asd?asd/A/sd;;lasd"
In case it might be something with texts:
String a = "Meu pai é um Grande "baio" de fada";
a = a.replaceAll("\"([a-zA-Z0-9\s]+)\"", "\"$1\"");
In this case you will find everyone inside the quotation marks, for example "a e 0 9"
Browser other questions tagged java
You are not signed in. Login or sign up in order to post.
Thank you, you answered my question
– Tiago Ferezin