How to replace one double inverted quote with two single inverted qoutes in java -


i want sample program replace double inverted quote 2 single inverted quotes.

example:

input :

"hello","my name xyz" 

output:

``hello'',``my name xyz'' 

help appreciated.

you use regular expressions follows:

str = str.replaceall("\"(.*?)\"", "``$1''"); 

(note unmatched " in end left is.)

ideone.com demo


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -