Here you can find the source of decamelizeAndReplaceByHyphen(String s)
Parameter | Description |
---|---|
s | raw string |
static public String decamelizeAndReplaceByHyphen(String s)
//package com.java2s; //License from project: Open Source License public class Main { /** /*from ww w . j av a 2s . c om*/ * Replaces the Capital letters with lower letters and prefixed with a hyphen if not in the beginning of the string. * For instance PTM info becomes ptm-info and modifiedResidue becomes modified-residue * @param s raw string * @return the string processed */ static public String decamelizeAndReplaceByHyphen(String s) { return s.trim().replaceAll("(\\p{Ll})(\\p{Lu})", "$1 $2").replaceAll(" ", "-").toLowerCase(); } }