Java String Abbreviate abbreviationtoLetter(String mutation)

Here you can find the source of abbreviationtoLetter(String mutation)

Description

abbreviationto Letter

License

Open Source License

Declaration

public static String abbreviationtoLetter(String mutation) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String abbreviationtoLetter(String mutation) {
        return mutation.replaceAll("Ala", "A").replaceAll("Cys", "C").replaceAll("Glu", "E").replaceAll("Phe", "F")
                .replaceAll("Gly", "G").replaceAll("His", "H").replaceAll("Ile", "I").replaceAll("Lys", "K")
                .replaceAll("Leu", "L").replaceAll("Met", "M").replaceAll("Asn", "N").replaceAll("Hyp", "O")
                .replaceAll("Pro", "P").replaceAll("Gln", "Q").replaceAll("Arg", "R").replaceAll("Ser", "S")
                .replaceAll("Thr", "T").replaceAll("Glp", "U").replaceAll("Val", "V").replaceAll("Trp", "W")
                .replaceAll("Ter", "X").replaceAll("Tyr", "Y");
    }//from w w  w. ja v a  2 s .  co  m
}

Related

  1. abbreviateObj(Object value, int maxWidth)
  2. abbreviateScript(String script)
  3. abbreviateText(final String text, final int numberOfCharacters, final String appendText)
  4. abbreviateText(String text, int maxLength)
  5. abbreviation(String description)
  6. abbrv(String str, int max)