public static String camelToHypenNotation(String str){
  if (isEmpty(str))   return str;
  StringBuilder sb=new StringBuilder();
  char c;
  sb.append(Character.toLowerCase(str.charAt(0)));
  for (int i=1; i < str.length(); i++) {
    c=str.charAt(i);
    if (Character.isUpperCase(c)) {
      sb.append('-');
      sb.append(Character.toLowerCase(c));
    }
 else     sb.append(c);
  }
  return sb.toString();
}

public static String camelToHypenNotation ( String str ) { if ( isEmpty ( str ) ) return str ; StringBuilder sb = new StringBuilder ( ) ; char c ; sb . append ( Character . toLowerCase ( str . charAt ( 0 ) ) ) ; for ( int i = 1 ; i < str . length ( ) ; i ++ ) { c = str . charAt ( i ) ; if ( Character . isUpperCase ( c ) ) { sb . append ( '-' ) ; sb . append ( Character . toLowerCase ( c ) ) ; } else sb . append ( c ) ; } return sb . toString ( ) ; }
translate a string in camel notation to a string in hypen notation example : helloworld - > hello - world
