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

前端 未结 7 1598
梦毁少年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);
    
    0 讨论(0)
提交回复
热议问题