Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** convert given "directiveName" to "directive-name" */
    private static String getDirectiveNameAsHtmlAttribute(String directiveName) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < directiveName.length(); i++) {
            char ch = directiveName.charAt(i);
            if (Character.isUpperCase(ch)) {
                sb.append('-');
                ch = Character.toLowerCase(ch);
            }
            sb.append(ch);
        }
        return sb.toString();
    }
}