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

io.dropwizard.metrics5.graphite.GraphiteSanitize Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
package io.dropwizard.metrics5.graphite;

import java.util.regex.Pattern;

class GraphiteSanitize {

    private static final Pattern WHITESPACE = Pattern.compile("[\\s]+");
    private static final String DASH = "-";

    /**
     * Trims the string and replaces all whitespace characters with the provided symbol
     */
    static String sanitize(String string) {
        return WHITESPACE.matcher(string.trim()).replaceAll(DASH);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy