I want to transform in Java:
dd fdas dd fdas fads f das fdasf + - || dasf
into:
"dd" "fdas" "dd" "fdas" "fads" "f" "das" "fdasf" + - || "dasf"
basically I want to add quotes around words. \w* -> "\w*\"
replaceAll
can do this:
String result = input.replaceAll("(\w+)", "\"$1\"");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With