String.replaceAll() is not working

后端 未结 6 1634
野趣味
野趣味 2020-12-03 13:45

I am editing some email that got from tesseract ocr.

Here is my code:

 if (email != null) {
        email = email.replaceAll(\" \",         


        
6条回答
  •  感情败类
    2020-12-03 14:30

    By realizing that replaceAll() first argument is regex you can make your comparisons much less

    For example you can check for possible misspellings of the word career by the following regex

    email = email.replaceAll("ca[n|r][e|a][e|a]r", "career"));

提交回复
热议问题