All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.core.snippets.UnderscoreJoiner Maven / Gradle / Ivy

There is a newer version: 7.18.0
Show newest version
package io.cucumber.core.snippets;

class UnderscoreJoiner implements Joiner {

    @Override
    public String concatenate(String[] words) {
        StringBuilder functionName = new StringBuilder();
        boolean firstWord = true;
        for (String word : words) {
            if (firstWord) {
                word = word.toLowerCase();
            } else {
                functionName.append('_');
            }
            functionName.append(word);
            firstWord = false;
        }
        return functionName.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy