Java replace issues with ' (apostrophe/single quote) and \ (backslash) together

前端 未结 7 1622
梦毁少年i
梦毁少年i 2021-01-30 18:03

I seem to be having issues. I have a query string that has values that can contain single quotes. This will break the query string. So I was trying to do a replace to change

7条回答
  •  无人共我
    2021-01-30 18:32

    Example :

    String teste = " 'Bauru '";
    
    teste = teste.replaceAll("  '  ","");
    JOptionPane.showMessageDialog(null,teste);
    

提交回复
热议问题