package com.iqser.red.service.persistence.management.v1.processor.utils;

import java.util.Locale;

public class SnakeCaseUtils {

    public static String toSnakeCase(String input) {

        return input.replaceAll("([a-z])([A-Z])", "$1_$2").replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2").replaceAll("[\\s-]+", "_").toLowerCase(Locale.getDefault());
    }

}
