As shown below:
//Example String String with special symbol String str = "My Name (test)";//Remove the special character content in which "()" is the special character str.replaceAll("[^0-9a-zA-Z/u4e00-/u9fa5.,,.? ""]+","); //Remove the special symbol String content: System.out.println("String str: " + str");//Str: My name testThe above example of removing special characters from Java strings is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.