public static String removeContinuousChar(String str, char target) {
        if (str == null || str.length() < 2) {
            return str;
        }
        int start = 0;
        int end = str.length() - 1;
        while (start <= end && str.charAt(start) == target) {
            start++;
        }
        while (end >= start && str.charAt(end) == target) {
            end--;
        }
        return str.substring(start, end + 1);
    }
remove the continuous char in the string from both sides.
@param str the input string, target the char to be removed
@return the string without continuous chars from both sides
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/ddl/Utils/ColumnUtils.java