code: public static String toDashCase(String memberName)
    {
      if(memberName == null) {
        return null;
      }
      final int length = memberName.length();
      StringBuilder builder = new StringBuilder(length);
  
      for(int i = 0; i < length; i++) {
        char c = memberName.charAt(i);
        if(Character.isLowerCase(c)) {
          builder.append(c);
          continue;
        }
  
        c = Character.toLowerCase(c);
        if(i > 0) {
          builder.append('-');
        }
        builder.append(c);
      }
      return builder.toString();
    }
docs: Convert Java member name to list of lower case words separated by dash, that is, HTML and CSS name convention.
  <p>
  Returns null if member name argument is null and empty if empty.
  
  @param memberName Java style, camel case member name.
  @return dashed string.