- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
41 lines
1.6 KiB
Java
41 lines
1.6 KiB
Java
package kotlin.text;
|
|
|
|
import java.util.NoSuchElementException;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.ranges.RangesKt___RangesKt;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class StringsKt___StringsKt extends StringsKt___StringsJvmKt {
|
|
public static char last(CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (charSequence.length() == 0) {
|
|
throw new NoSuchElementException("Char sequence is empty.");
|
|
}
|
|
return charSequence.charAt(StringsKt__StringsKt.getLastIndex(charSequence));
|
|
}
|
|
|
|
public static final String drop(String str, int i) {
|
|
int coerceAtMost;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
if (i < 0) {
|
|
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
|
|
}
|
|
coerceAtMost = RangesKt___RangesKt.coerceAtMost(i, str.length());
|
|
String substring = str.substring(coerceAtMost);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static String take(String str, int i) {
|
|
int coerceAtMost;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
if (i < 0) {
|
|
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
|
|
}
|
|
coerceAtMost = RangesKt___RangesKt.coerceAtMost(i, str.length());
|
|
String substring = str.substring(0, coerceAtMost);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
}
|