string.replace comma code example Example: replace comma from a string String names = "{\"lucy,john,frank\"}"; String newNames = names.replace(",", "\",\"");