// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.tweakr;

public class TextUtils {

    public static boolean isEmpty(String targetPrefix) {
        return targetPrefix == null || targetPrefix.length() == 0;
    }

    public static String decapitalize(String capitalized) {
        if (capitalized.length() < 2) {
            return capitalized.toLowerCase();
        }
        return capitalized.substring(0, 1).toLowerCase() + capitalized.substring(1);
    }
}

// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.tweakr;

import java.util.Locale;

public class TextUtils {

    public static boolean isEmpty(String targetPrefix) {
        return targetPrefix == null || targetPrefix.length() == 0;
    }

    public static String decapitalize(String capitalized) {
        Locale locale = Locale.getDefault();
        if (capitalized.length() < 2) {
            return capitalized.toLowerCase(locale);
        }
        return capitalized.substring(0, 1).toLowerCase(locale) + capitalized.substring(1);
    }
}

add default locale (#40)