What is the fastest way to implement the perl operator tr///?
For instance, if I were to have a String "ATGCATGC" and I use perl tr/GTCA/CAGT/ then I would get "TACGTACG".
Is there a single java function that does this?
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.
As others have commented, Apache Commons StringUtils will do it for you. So will this method, though: