I am looking for a Java 5 lbrary which let me compare some text as following lines returns true:
" foo bar " == "foo bar""foo\nbar" == "foo bar""foo\tbar" == "foo bar""féé bar" == "fee bar"- and so on…
Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think you’ll find a library with these specific rules. You’ll have to code them yourself. For some of the rules, regular expressions or even the
Stringframework methods can be useful, but, for the last rule, I think you’ll have to keep aMapof equality for those special chars. Then, you’ll have to iterate through each char in the string comparing them using this Map. And, since you’re iterating already through the string maybe you could apply all the rules in one iteration, avoiding regular expressions.