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

cucumber.runtime.snippets.UnderscoreConcatenator Maven / Gradle / Ivy

There is a newer version: 7.18.1
Show newest version
package cucumber.runtime.snippets;

public class UnderscoreConcatenator implements Concatenator {
    @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