package d.s0;

import java.util.NoSuchElementException;

/* JADX INFO: Access modifiers changed from: package-private */
/* JADX INFO: compiled from: _Strings.kt */
/* JADX INFO: loaded from: classes.dex */
@d.n
public class t extends s {
    public static String i0(String str, int i) {
        d.n0.c.s.e(str, "<this>");
        if (i >= 0) {
            String strSubstring = str.substring(d.p0.n.c(i, str.length()));
            d.n0.c.s.d(strSubstring, "this as java.lang.String).substring(startIndex)");
            return strSubstring;
        }
        throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
    }

    public static char j0(CharSequence charSequence) {
        d.n0.c.s.e(charSequence, "<this>");
        if (charSequence.length() == 0) {
            throw new NoSuchElementException("Char sequence is empty.");
        }
        return charSequence.charAt(r.z(charSequence));
    }

    public static char k0(CharSequence charSequence) {
        d.n0.c.s.e(charSequence, "<this>");
        int length = charSequence.length();
        if (length == 0) {
            throw new NoSuchElementException("Char sequence is empty.");
        }
        if (length == 1) {
            return charSequence.charAt(0);
        }
        throw new IllegalArgumentException("Char sequence has more than one element.");
    }
}
