Rabbit-R1/android (non root)/java/sources/kotlin/text/StringsKt___StringsKt.java

2316 lines
148 KiB
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package kotlin.text;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.exifinterface.media.ExifInterface;
import androidx.media3.exoplayer.upstream.CmcdHeadersFactory;
import io.sentry.protocol.MetricSummary;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import kotlin.Deprecated;
import kotlin.DeprecatedSinceKotlin;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.ReplaceWith;
import kotlin.TuplesKt;
import kotlin.UInt;
import kotlin.ULong;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.Grouping;
import kotlin.collections.IndexedValue;
import kotlin.collections.IndexingIterable;
import kotlin.collections.MapsKt;
import kotlin.collections.SetsKt;
import kotlin.collections.SlidingWindowKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
import kotlin.random.Random;
import kotlin.ranges.IntRange;
import kotlin.ranges.RangesKt;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
import tech.rabbit.r1launcher.BuildConfig;
/* JADX INFO: Access modifiers changed from: package-private */
/* compiled from: _Strings.kt */
@Metadata(d1 = {"\u0000ö\u0001\n\u0000\n\u0002\u0010\u000b\n\u0002\u0010\r\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\f\n\u0002\b\u0002\n\u0002\u0010\u001c\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010%\n\u0002\b\b\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u000f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010\u0000\n\u0002\b\b\n\u0002\u0010\u001f\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0010!\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\u0010\u000f\n\u0002\b\u0005\n\u0002\u0010\u0006\n\u0002\u0010\u0007\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u001c\n\u0002\u0018\u0002\n\u0002\b\u0019\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\"\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0006\u001a$\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0012\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00010\u0004H\u0086\\u0001\u0000\u001a\n\u0010\u0006\u001a\u00020\u0001*\u00020\u0002\u001a$\u0010\u0006\u001a\u00020\u0001*\u00020\u00022\u0012\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00010\u0004H\u0086\\u0001\u0000\u001a\u0010\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\u00050\b*\u00020\u0002\u001a\u0010\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u00050\n*\u00020\u0002\u001aH\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u0002H\r\u0012\u0004\u0012\u0002H\u000e0\f\"\u0004\b\u0000\u0010\r\"\u0004\b\u0001\u0010\u000e*\u00020\u00022\u001e\u0010\u000f\u001a\u001a\u0012\u0004\u0012\u00020\u0005\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\r\u0012\u0004\u0012\u0002H\u000e0\u00100\u0004H\u0086\\u0001\u0000\u001a6\u0010\u0011\u001a\u000e\u0012\u0004\u0012\u0002H\r\u0012\u0004\u0012\u00020\u00050\f\"\u0004\b\u0000\u0010\r*\u00020\u00022\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\r0\u0004H\u0086\\u0001\u0000\u001aP\u0010\u0011\u001a\u000e\u0012\u0004\u0012\u0002H\r\u0012\u0004\u0012\u0002H\u000e0\f\"\u0004\b\u0000\u0010\r\"\u0004\b\u0001\u0010\u000e*\u00020\u00022\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\r0\u00042\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\u000e0\u0004H\u0086\\u0001\u0000\u001aQ\u0010\u0014\u001a\u0002H\u0015\"\u0004\b\u0000\u0010\r\"\u0018\b\u0001\u0010\u0015*\u0012\u0012\u0006\b\u0000\u0012\u0002H\r\u0012\u0006\b\u0000\u0012\u00020\u00050\u0016*\u00020\u00022\u0006\u0010\u0017\u001a\u0002H\u00152\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\r0\u0004H\u0086\\u0001\u0000¢\u0006\u0002\u0010\u0018\u001ak\u0010\u0014\u001a\u0002H\u0015\"\u0004\b\u0000\u0010\r\"\u0004\b\u0001\u0010\u000e\"\u0018\b\u0002\u0010\u0015*\u0012\u0012\u0006\b\u0000\u0012\u0002H\r\u0012\u0006\b\u0000\u0012\u0002H\u000e0\u0016*\u00020\u00022\u0006\u0010\u0017\u001a\u0002H\u00152\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\r0\u00042\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\u000e0\u0004H\u0086\\u0001\u0000¢\u0006\u0002\u0010\u0019\u001ac\u0010\u001a\u001a\u0002H\u0015\"\u0004\b\u0000\u0010\r\"\u0004\b\u0001\u0010\u000e\"\u0018\b\u0002\u0010\u0015*\u0012\u0012\u0006\b\u0000\u0012\u0002H\r\u0012\u0006\b\u0000\u0012\u0002H\u000e0\u0016*\u00020\u00022\u0006\u0010\u0017\u001a\u0002H\u00152\u001e\u0010\u000f\u001a\u001a\u0012\u0004\u0012\u00020\u0005\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\r\u0012\u0004\u0012\u0002H\u000e0\u00100\u0004H\u0086\\u0001\u0000¢\u0006\u0002\u0010\u0018\u001a6\u0010\u001b\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u0002H\u000e0\f\"\u0004\b\u0000\u0010\u000e*\u00
/* loaded from: classes3.dex */
public class StringsKt___StringsKt extends StringsKt___StringsJvmKt {
private static final char elementAtOrElse(CharSequence charSequence, int i, Function1<? super Integer, Character> defaultValue) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
return (i < 0 || i > StringsKt.getLastIndex(charSequence)) ? defaultValue.invoke(Integer.valueOf(i)).charValue() : charSequence.charAt(i);
}
private static final Character elementAtOrNull(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.getOrNull(charSequence, i);
}
public static final char first(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
throw new NoSuchElementException("Char sequence is empty.");
}
return charSequence.charAt(0);
}
public static final char first(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
return charAt;
}
}
throw new NoSuchElementException("Char sequence contains no character matching the predicate.");
}
private static final <R> R firstNotNullOf(CharSequence charSequence, Function1<? super Character, ? extends R> transform) {
R r;
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
int i = 0;
while (true) {
if (i >= charSequence.length()) {
r = null;
break;
}
r = transform.invoke(Character.valueOf(charSequence.charAt(i)));
if (r != null) {
break;
}
i++;
}
if (r != null) {
return r;
}
throw new NoSuchElementException("No element of the char sequence was transformed to a non-null value.");
}
private static final <R> R firstNotNullOfOrNull(CharSequence charSequence, Function1<? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
for (int i = 0; i < charSequence.length(); i++) {
R invoke = transform.invoke(Character.valueOf(charSequence.charAt(i)));
if (invoke != null) {
return invoke;
}
}
return null;
}
public static final Character firstOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
return null;
}
return Character.valueOf(charSequence.charAt(0));
}
public static final Character firstOrNull(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
return Character.valueOf(charAt);
}
}
return null;
}
private static final char getOrElse(CharSequence charSequence, int i, Function1<? super Integer, Character> defaultValue) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
return (i < 0 || i > StringsKt.getLastIndex(charSequence)) ? defaultValue.invoke(Integer.valueOf(i)).charValue() : charSequence.charAt(i);
}
public static final Character getOrNull(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (i < 0 || i > StringsKt.getLastIndex(charSequence)) {
return null;
}
return Character.valueOf(charSequence.charAt(i));
}
public static final int indexOfFirst(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length();
for (int i = 0; i < length; i++) {
if (predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return i;
}
}
return -1;
}
public static final int indexOfLast(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length() - 1;
if (length >= 0) {
while (true) {
int i = length - 1;
if (predicate.invoke(Character.valueOf(charSequence.charAt(length))).booleanValue()) {
return length;
}
if (i < 0) {
break;
}
length = i;
}
}
return -1;
}
public static final char last(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
throw new NoSuchElementException("Char sequence is empty.");
}
return charSequence.charAt(StringsKt.getLastIndex(charSequence));
}
public static final char last(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length() - 1;
if (length >= 0) {
while (true) {
int i = length - 1;
char charAt = charSequence.charAt(length);
if (!predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
if (i < 0) {
break;
}
length = i;
} else {
return charAt;
}
}
}
throw new NoSuchElementException("Char sequence contains no character matching the predicate.");
}
public static final Character lastOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
return null;
}
return Character.valueOf(charSequence.charAt(charSequence.length() - 1));
}
public static final Character lastOrNull(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length() - 1;
if (length < 0) {
return null;
}
while (true) {
int i = length - 1;
char charAt = charSequence.charAt(length);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
return Character.valueOf(charAt);
}
if (i < 0) {
return null;
}
length = i;
}
}
private static final char random(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.random(charSequence, Random.INSTANCE);
}
public static final char random(CharSequence charSequence, Random random) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(random, "random");
if (charSequence.length() == 0) {
throw new NoSuchElementException("Char sequence is empty.");
}
return charSequence.charAt(random.nextInt(charSequence.length()));
}
private static final Character randomOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.randomOrNull(charSequence, Random.INSTANCE);
}
public static final Character randomOrNull(CharSequence charSequence, Random random) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(random, "random");
if (charSequence.length() == 0) {
return null;
}
return Character.valueOf(charSequence.charAt(random.nextInt(charSequence.length())));
}
public static final char single(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(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.");
}
public static final char single(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
Character ch = null;
boolean z = false;
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
if (z) {
throw new IllegalArgumentException("Char sequence contains more than one matching element.");
}
ch = Character.valueOf(charAt);
z = true;
}
}
if (!z) {
throw new NoSuchElementException("Char sequence contains no character matching the predicate.");
}
Intrinsics.checkNotNull(ch, "null cannot be cast to non-null type kotlin.Char");
return ch.charValue();
}
public static final Character singleOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 1) {
return Character.valueOf(charSequence.charAt(0));
}
return null;
}
public static final Character singleOrNull(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
Character ch = null;
boolean z = false;
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
if (z) {
return null;
}
ch = Character.valueOf(charAt);
z = true;
}
}
if (z) {
return ch;
}
return null;
}
public static final CharSequence drop(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
return charSequence.subSequence(RangesKt.coerceAtMost(i, charSequence.length()), charSequence.length());
}
public static final String drop(String str, int i) {
Intrinsics.checkNotNullParameter(str, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
String substring = str.substring(RangesKt.coerceAtMost(i, str.length()));
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
public static final CharSequence dropLast(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
return StringsKt.take(charSequence, RangesKt.coerceAtLeast(charSequence.length() - i, 0));
}
public static final String dropLast(String str, int i) {
Intrinsics.checkNotNullParameter(str, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
return StringsKt.take(str, RangesKt.coerceAtLeast(str.length() - i, 0));
}
public static final CharSequence dropLastWhile(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int lastIndex = StringsKt.getLastIndex(charSequence); -1 < lastIndex; lastIndex--) {
if (!predicate.invoke(Character.valueOf(charSequence.charAt(lastIndex))).booleanValue()) {
return charSequence.subSequence(0, lastIndex + 1);
}
}
return "";
}
public static final String dropLastWhile(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int lastIndex = StringsKt.getLastIndex(str); -1 < lastIndex; lastIndex--) {
if (!predicate.invoke(Character.valueOf(str.charAt(lastIndex))).booleanValue()) {
String substring = str.substring(0, lastIndex + 1);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
}
return "";
}
public static final CharSequence dropWhile(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length();
for (int i = 0; i < length; i++) {
if (!predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return charSequence.subSequence(i, charSequence.length());
}
}
return "";
}
public static final String dropWhile(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = str.length();
for (int i = 0; i < length; i++) {
if (!predicate.invoke(Character.valueOf(str.charAt(i))).booleanValue()) {
String substring = str.substring(i);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
}
return "";
}
public static final CharSequence filter(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
StringBuilder sb = new StringBuilder();
int length = charSequence.length();
for (int i = 0; i < length; i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
}
return sb;
}
public static final String filter(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
String str2 = str;
StringBuilder sb = new StringBuilder();
int length = str2.length();
for (int i = 0; i < length; i++) {
char charAt = str2.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
public static final CharSequence filterIndexed(CharSequence charSequence, Function2<? super Integer, ? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
StringBuilder sb = new StringBuilder();
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
char charAt = charSequence.charAt(i);
int i3 = i2 + 1;
if (predicate.invoke(Integer.valueOf(i2), Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
i++;
i2 = i3;
}
return sb;
}
public static final String filterIndexed(String str, Function2<? super Integer, ? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
String str2 = str;
StringBuilder sb = new StringBuilder();
int i = 0;
int i2 = 0;
while (i < str2.length()) {
char charAt = str2.charAt(i);
int i3 = i2 + 1;
if (predicate.invoke(Integer.valueOf(i2), Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
i++;
i2 = i3;
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
public static final CharSequence filterNot(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (!predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
}
return sb;
}
public static final String filterNot(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
String str2 = str;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str2.length(); i++) {
char charAt = str2.charAt(i);
if (!predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
}
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
public static final <C extends Appendable> C filterNotTo(CharSequence charSequence, C destination, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (!predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
destination.append(charAt);
}
}
return destination;
}
public static final <C extends Appendable> C filterTo(CharSequence charSequence, C destination, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length();
for (int i = 0; i < length; i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
destination.append(charAt);
}
}
return destination;
}
public static final CharSequence slice(CharSequence charSequence, IntRange indices) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(indices, "indices");
return indices.isEmpty() ? "" : StringsKt.subSequence(charSequence, indices);
}
public static final String slice(String str, IntRange indices) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(indices, "indices");
return indices.isEmpty() ? "" : StringsKt.substring(str, indices);
}
public static final CharSequence slice(CharSequence charSequence, Iterable<Integer> indices) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(indices, "indices");
int collectionSizeOrDefault = CollectionsKt.collectionSizeOrDefault(indices, 10);
if (collectionSizeOrDefault == 0) {
return "";
}
StringBuilder sb = new StringBuilder(collectionSizeOrDefault);
Iterator<Integer> it = indices.iterator();
while (it.hasNext()) {
sb.append(charSequence.charAt(it.next().intValue()));
}
return sb;
}
private static final String slice(String str, Iterable<Integer> indices) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(indices, "indices");
return StringsKt.slice((CharSequence) str, indices).toString();
}
public static final CharSequence take(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
return charSequence.subSequence(0, RangesKt.coerceAtMost(i, charSequence.length()));
}
public static final String take(String str, int i) {
Intrinsics.checkNotNullParameter(str, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
String substring = str.substring(0, RangesKt.coerceAtMost(i, str.length()));
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
public static final CharSequence takeLast(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
int length = charSequence.length();
return charSequence.subSequence(length - RangesKt.coerceAtMost(i, length), length);
}
public static final String takeLast(String str, int i) {
Intrinsics.checkNotNullParameter(str, "<this>");
if (i < 0) {
throw new IllegalArgumentException(("Requested character count " + i + " is less than zero.").toString());
}
int length = str.length();
String substring = str.substring(length - RangesKt.coerceAtMost(i, length));
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
public static final CharSequence takeLastWhile(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int lastIndex = StringsKt.getLastIndex(charSequence); -1 < lastIndex; lastIndex--) {
if (!predicate.invoke(Character.valueOf(charSequence.charAt(lastIndex))).booleanValue()) {
return charSequence.subSequence(lastIndex + 1, charSequence.length());
}
}
return charSequence.subSequence(0, charSequence.length());
}
public static final String takeLastWhile(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int lastIndex = StringsKt.getLastIndex(str); -1 < lastIndex; lastIndex--) {
if (!predicate.invoke(Character.valueOf(str.charAt(lastIndex))).booleanValue()) {
String substring = str.substring(lastIndex + 1);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
}
return str;
}
public static final CharSequence takeWhile(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length();
for (int i = 0; i < length; i++) {
if (!predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return charSequence.subSequence(0, i);
}
}
return charSequence.subSequence(0, charSequence.length());
}
public static final String takeWhile(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = str.length();
for (int i = 0; i < length; i++) {
if (!predicate.invoke(Character.valueOf(str.charAt(i))).booleanValue()) {
String substring = str.substring(0, i);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
return substring;
}
}
return str;
}
public static final CharSequence reversed(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
StringBuilder reverse = new StringBuilder(charSequence).reverse();
Intrinsics.checkNotNullExpressionValue(reverse, "reverse(...)");
return reverse;
}
private static final String reversed(String str) {
Intrinsics.checkNotNullParameter(str, "<this>");
return StringsKt.reversed((CharSequence) str).toString();
}
public static final <K, V> Map<K, V> associate(CharSequence charSequence, Function1<? super Character, ? extends Pair<? extends K, ? extends V>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
LinkedHashMap linkedHashMap = new LinkedHashMap(RangesKt.coerceAtLeast(MapsKt.mapCapacity(charSequence.length()), 16));
for (int i = 0; i < charSequence.length(); i++) {
Pair<? extends K, ? extends V> invoke = transform.invoke(Character.valueOf(charSequence.charAt(i)));
linkedHashMap.put(invoke.getFirst(), invoke.getSecond());
}
return linkedHashMap;
}
public static final <K> Map<K, Character> associateBy(CharSequence charSequence, Function1<? super Character, ? extends K> keySelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
LinkedHashMap linkedHashMap = new LinkedHashMap(RangesKt.coerceAtLeast(MapsKt.mapCapacity(charSequence.length()), 16));
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
linkedHashMap.put(keySelector.invoke(Character.valueOf(charAt)), Character.valueOf(charAt));
}
return linkedHashMap;
}
public static final <K, V> Map<K, V> associateBy(CharSequence charSequence, Function1<? super Character, ? extends K> keySelector, Function1<? super Character, ? extends V> valueTransform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
Intrinsics.checkNotNullParameter(valueTransform, "valueTransform");
LinkedHashMap linkedHashMap = new LinkedHashMap(RangesKt.coerceAtLeast(MapsKt.mapCapacity(charSequence.length()), 16));
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
linkedHashMap.put(keySelector.invoke(Character.valueOf(charAt)), valueTransform.invoke(Character.valueOf(charAt)));
}
return linkedHashMap;
}
public static final <K, M extends Map<? super K, ? super Character>> M associateByTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends K> keySelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
destination.put(keySelector.invoke(Character.valueOf(charAt)), Character.valueOf(charAt));
}
return destination;
}
public static final <K, V, M extends Map<? super K, ? super V>> M associateByTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends K> keySelector, Function1<? super Character, ? extends V> valueTransform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
Intrinsics.checkNotNullParameter(valueTransform, "valueTransform");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
destination.put(keySelector.invoke(Character.valueOf(charAt)), valueTransform.invoke(Character.valueOf(charAt)));
}
return destination;
}
public static final <K, V, M extends Map<? super K, ? super V>> M associateTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends Pair<? extends K, ? extends V>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
for (int i = 0; i < charSequence.length(); i++) {
Pair<? extends K, ? extends V> invoke = transform.invoke(Character.valueOf(charSequence.charAt(i)));
destination.put(invoke.getFirst(), invoke.getSecond());
}
return destination;
}
public static final <V> Map<Character, V> associateWith(CharSequence charSequence, Function1<? super Character, ? extends V> valueSelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(valueSelector, "valueSelector");
LinkedHashMap linkedHashMap = new LinkedHashMap(RangesKt.coerceAtLeast(MapsKt.mapCapacity(RangesKt.coerceAtMost(charSequence.length(), 128)), 16));
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
linkedHashMap.put(Character.valueOf(charAt), valueSelector.invoke(Character.valueOf(charAt)));
}
return linkedHashMap;
}
public static final <V, M extends Map<? super Character, ? super V>> M associateWithTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends V> valueSelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(valueSelector, "valueSelector");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
destination.put(Character.valueOf(charAt), valueSelector.invoke(Character.valueOf(charAt)));
}
return destination;
}
public static final <C extends Collection<? super Character>> C toCollection(CharSequence charSequence, C destination) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
for (int i = 0; i < charSequence.length(); i++) {
destination.add(Character.valueOf(charSequence.charAt(i)));
}
return destination;
}
public static final HashSet<Character> toHashSet(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return (HashSet) StringsKt.toCollection(charSequence, new HashSet(MapsKt.mapCapacity(RangesKt.coerceAtMost(charSequence.length(), 128))));
}
public static final List<Character> toList(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
int length = charSequence.length();
if (length == 0) {
return CollectionsKt.emptyList();
}
if (length == 1) {
return CollectionsKt.listOf(Character.valueOf(charSequence.charAt(0)));
}
return StringsKt.toMutableList(charSequence);
}
public static final List<Character> toMutableList(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return (List) StringsKt.toCollection(charSequence, new ArrayList(charSequence.length()));
}
public static final Set<Character> toSet(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
int length = charSequence.length();
if (length == 0) {
return SetsKt.emptySet();
}
if (length == 1) {
return SetsKt.setOf(Character.valueOf(charSequence.charAt(0)));
}
return (Set) StringsKt.toCollection(charSequence, new LinkedHashSet(MapsKt.mapCapacity(RangesKt.coerceAtMost(charSequence.length(), 128))));
}
public static final <R> List<R> flatMap(CharSequence charSequence, Function1<? super Character, ? extends Iterable<? extends R>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList();
for (int i = 0; i < charSequence.length(); i++) {
CollectionsKt.addAll(arrayList, transform.invoke(Character.valueOf(charSequence.charAt(i))));
}
return arrayList;
}
private static final <R> List<R> flatMapIndexedIterable(CharSequence charSequence, Function2<? super Integer, ? super Character, ? extends Iterable<? extends R>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList();
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
CollectionsKt.addAll(arrayList, transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i))));
i++;
i2++;
}
return arrayList;
}
private static final <R, C extends Collection<? super R>> C flatMapIndexedIterableTo(CharSequence charSequence, C destination, Function2<? super Integer, ? super Character, ? extends Iterable<? extends R>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
CollectionsKt.addAll(destination, transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i))));
i++;
i2++;
}
return destination;
}
public static final <R, C extends Collection<? super R>> C flatMapTo(CharSequence charSequence, C destination, Function1<? super Character, ? extends Iterable<? extends R>> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
for (int i = 0; i < charSequence.length(); i++) {
CollectionsKt.addAll(destination, transform.invoke(Character.valueOf(charSequence.charAt(i))));
}
return destination;
}
public static final <K> Map<K, List<Character>> groupBy(CharSequence charSequence, Function1<? super Character, ? extends K> keySelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
K invoke = keySelector.invoke(Character.valueOf(charAt));
Object obj = linkedHashMap.get(invoke);
if (obj == null) {
obj = (List) new ArrayList();
linkedHashMap.put(invoke, obj);
}
((List) obj).add(Character.valueOf(charAt));
}
return linkedHashMap;
}
public static final <K, V> Map<K, List<V>> groupBy(CharSequence charSequence, Function1<? super Character, ? extends K> keySelector, Function1<? super Character, ? extends V> valueTransform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
Intrinsics.checkNotNullParameter(valueTransform, "valueTransform");
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
K invoke = keySelector.invoke(Character.valueOf(charAt));
ArrayList arrayList = linkedHashMap.get(invoke);
if (arrayList == null) {
arrayList = new ArrayList();
linkedHashMap.put(invoke, arrayList);
}
arrayList.add(valueTransform.invoke(Character.valueOf(charAt)));
}
return linkedHashMap;
}
public static final <K, M extends Map<? super K, List<Character>>> M groupByTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends K> keySelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
K invoke = keySelector.invoke(Character.valueOf(charAt));
Object obj = destination.get(invoke);
if (obj == null) {
obj = (List) new ArrayList();
destination.put(invoke, obj);
}
((List) obj).add(Character.valueOf(charAt));
}
return destination;
}
/* JADX WARN: Multi-variable type inference failed */
public static final <K, V, M extends Map<? super K, List<V>>> M groupByTo(CharSequence charSequence, M destination, Function1<? super Character, ? extends K> keySelector, Function1<? super Character, ? extends V> valueTransform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
Intrinsics.checkNotNullParameter(valueTransform, "valueTransform");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
K invoke = keySelector.invoke(Character.valueOf(charAt));
Object obj = destination.get(invoke);
if (obj == null) {
obj = (List) new ArrayList();
destination.put(invoke, obj);
}
((List) obj).add(valueTransform.invoke(Character.valueOf(charAt)));
}
return destination;
}
public static final <K> Grouping<Character, K> groupingBy(final CharSequence charSequence, final Function1<? super Character, ? extends K> keySelector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
return new Grouping<Character, K>() { // from class: kotlin.text.StringsKt___StringsKt$groupingBy$1
@Override // kotlin.collections.Grouping
public /* bridge */ /* synthetic */ Object keyOf(Character ch) {
return keyOf(ch.charValue());
}
@Override // kotlin.collections.Grouping
public Iterator<Character> sourceIterator() {
return StringsKt.iterator(charSequence);
}
public K keyOf(char element) {
return keySelector.invoke(Character.valueOf(element));
}
};
}
public static final <R> List<R> map(CharSequence charSequence, Function1<? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList(charSequence.length());
for (int i = 0; i < charSequence.length(); i++) {
arrayList.add(transform.invoke(Character.valueOf(charSequence.charAt(i))));
}
return arrayList;
}
public static final <R> List<R> mapIndexed(CharSequence charSequence, Function2<? super Integer, ? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList(charSequence.length());
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
arrayList.add(transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i))));
i++;
i2++;
}
return arrayList;
}
public static final <R> List<R> mapIndexedNotNull(CharSequence charSequence, Function2<? super Integer, ? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList();
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
int i3 = i2 + 1;
R invoke = transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i)));
if (invoke != null) {
arrayList.add(invoke);
}
i++;
i2 = i3;
}
return arrayList;
}
public static final <R, C extends Collection<? super R>> C mapIndexedTo(CharSequence charSequence, C destination, Function2<? super Integer, ? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
destination.add(transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i))));
i++;
i2++;
}
return destination;
}
public static final <R> List<R> mapNotNull(CharSequence charSequence, Function1<? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
ArrayList arrayList = new ArrayList();
for (int i = 0; i < charSequence.length(); i++) {
R invoke = transform.invoke(Character.valueOf(charSequence.charAt(i)));
if (invoke != null) {
arrayList.add(invoke);
}
}
return arrayList;
}
public static final <R, C extends Collection<? super R>> C mapTo(CharSequence charSequence, C destination, Function1<? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
for (int i = 0; i < charSequence.length(); i++) {
destination.add(transform.invoke(Character.valueOf(charSequence.charAt(i))));
}
return destination;
}
public static final Iterable<IndexedValue<Character>> withIndex(final CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return new IndexingIterable(new Function0<Iterator<? extends Character>>() { // from class: kotlin.text.StringsKt___StringsKt$withIndex$1
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final Iterator<? extends Character> invoke() {
return StringsKt.iterator(charSequence);
}
});
}
public static final boolean all(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
if (!predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return false;
}
}
return true;
}
public static final boolean any(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return !(charSequence.length() == 0);
}
public static final boolean any(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
if (predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return true;
}
}
return false;
}
private static final int count(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return charSequence.length();
}
public static final int count(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int i = 0;
for (int i2 = 0; i2 < charSequence.length(); i2++) {
if (predicate.invoke(Character.valueOf(charSequence.charAt(i2))).booleanValue()) {
i++;
}
}
return i;
}
public static final <R> R fold(CharSequence charSequence, R r, Function2<? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
for (int i = 0; i < charSequence.length(); i++) {
r = operation.invoke(r, Character.valueOf(charSequence.charAt(i)));
}
return r;
}
public static final <R> R foldIndexed(CharSequence charSequence, R r, Function3<? super Integer, ? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
r = operation.invoke(Integer.valueOf(i2), r, Character.valueOf(charSequence.charAt(i)));
i++;
i2++;
}
return r;
}
public static final <R> R foldRight(CharSequence charSequence, R r, Function2<? super Character, ? super R, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
for (int lastIndex = StringsKt.getLastIndex(charSequence); lastIndex >= 0; lastIndex--) {
r = operation.invoke(Character.valueOf(charSequence.charAt(lastIndex)), r);
}
return r;
}
public static final <R> R foldRightIndexed(CharSequence charSequence, R r, Function3<? super Integer, ? super Character, ? super R, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
for (int lastIndex = StringsKt.getLastIndex(charSequence); lastIndex >= 0; lastIndex--) {
r = operation.invoke(Integer.valueOf(lastIndex), Character.valueOf(charSequence.charAt(lastIndex)), r);
}
return r;
}
public static final void forEach(CharSequence charSequence, Function1<? super Character, Unit> action) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
for (int i = 0; i < charSequence.length(); i++) {
action.invoke(Character.valueOf(charSequence.charAt(i)));
}
}
public static final void forEachIndexed(CharSequence charSequence, Function2<? super Integer, ? super Character, Unit> action) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
action.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i)));
i++;
i2++;
}
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char maxOrThrow(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (Intrinsics.compare((int) charAt, (int) charAt2) < 0) {
charAt = charAt2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final <R extends Comparable<? super R>> char maxByOrThrow(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex == 0) {
return charAt;
}
R invoke = selector.invoke(Character.valueOf(charAt));
?? it = new IntRange(1, lastIndex).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
R invoke2 = selector.invoke(Character.valueOf(charAt2));
if (invoke.compareTo(invoke2) < 0) {
charAt = charAt2;
invoke = invoke2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final <R extends Comparable<? super R>> Character maxByOrNull(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex == 0) {
return Character.valueOf(charAt);
}
R invoke = selector.invoke(Character.valueOf(charAt));
?? it = new IntRange(1, lastIndex).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
R invoke2 = selector.invoke(Character.valueOf(charAt2));
if (invoke.compareTo(invoke2) < 0) {
charAt = charAt2;
invoke = invoke2;
}
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r2v1, types: [kotlin.collections.IntIterator] */
private static final double maxOf(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
double doubleValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).doubleValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
doubleValue = Math.max(doubleValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).doubleValue());
}
return doubleValue;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: maxOf, reason: collision with other method in class */
private static final float m6990maxOf(CharSequence charSequence, Function1<? super Character, Float> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
float floatValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).floatValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
floatValue = Math.max(floatValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).floatValue());
}
return floatValue;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: maxOf, reason: collision with other method in class */
private static final <R extends Comparable<? super R>> R m6991maxOf(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
R invoke = selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
R invoke2 = selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (invoke.compareTo(invoke2) < 0) {
invoke = invoke2;
}
}
return invoke;
}
/* JADX WARN: Type inference failed for: r2v1, types: [kotlin.collections.IntIterator] */
/* renamed from: maxOfOrNull, reason: collision with other method in class */
private static final Double m6992maxOfOrNull(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
double doubleValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).doubleValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
doubleValue = Math.max(doubleValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).doubleValue());
}
return Double.valueOf(doubleValue);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: maxOfOrNull, reason: collision with other method in class */
private static final Float m6993maxOfOrNull(CharSequence charSequence, Function1<? super Character, Float> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
float floatValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).floatValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
floatValue = Math.max(floatValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).floatValue());
}
return Float.valueOf(floatValue);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R extends Comparable<? super R>> R maxOfOrNull(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
R invoke = selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
R invoke2 = selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (invoke.compareTo(invoke2) < 0) {
invoke = invoke2;
}
}
return invoke;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R> R maxOfWith(CharSequence charSequence, Comparator<? super R> comparator, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
Object obj = (R) selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
Object obj2 = (R) selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (comparator.compare(obj, obj2) < 0) {
obj = (R) obj2;
}
}
return (R) obj;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R> R maxOfWithOrNull(CharSequence charSequence, Comparator<? super R> comparator, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
Object obj = (R) selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
Object obj2 = (R) selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (comparator.compare(obj, obj2) < 0) {
obj = (R) obj2;
}
}
return (R) obj;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character maxOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (Intrinsics.compare((int) charAt, (int) charAt2) < 0) {
charAt = charAt2;
}
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char maxWithOrThrow(CharSequence charSequence, Comparator<? super Character> comparator) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (comparator.compare(Character.valueOf(charAt), Character.valueOf(charAt2)) < 0) {
charAt = charAt2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character maxWithOrNull(CharSequence charSequence, Comparator<? super Character> comparator) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (comparator.compare(Character.valueOf(charAt), Character.valueOf(charAt2)) < 0) {
charAt = charAt2;
}
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char minOrThrow(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (Intrinsics.compare((int) charAt, (int) charAt2) > 0) {
charAt = charAt2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final <R extends Comparable<? super R>> char minByOrThrow(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex == 0) {
return charAt;
}
R invoke = selector.invoke(Character.valueOf(charAt));
?? it = new IntRange(1, lastIndex).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
R invoke2 = selector.invoke(Character.valueOf(charAt2));
if (invoke.compareTo(invoke2) > 0) {
charAt = charAt2;
invoke = invoke2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final <R extends Comparable<? super R>> Character minByOrNull(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex == 0) {
return Character.valueOf(charAt);
}
R invoke = selector.invoke(Character.valueOf(charAt));
?? it = new IntRange(1, lastIndex).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
R invoke2 = selector.invoke(Character.valueOf(charAt2));
if (invoke.compareTo(invoke2) > 0) {
charAt = charAt2;
invoke = invoke2;
}
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r2v1, types: [kotlin.collections.IntIterator] */
private static final double minOf(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
double doubleValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).doubleValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
doubleValue = Math.min(doubleValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).doubleValue());
}
return doubleValue;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: minOf, reason: collision with other method in class */
private static final float m6994minOf(CharSequence charSequence, Function1<? super Character, Float> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
float floatValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).floatValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
floatValue = Math.min(floatValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).floatValue());
}
return floatValue;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: minOf, reason: collision with other method in class */
private static final <R extends Comparable<? super R>> R m6995minOf(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
R invoke = selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
R invoke2 = selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (invoke.compareTo(invoke2) > 0) {
invoke = invoke2;
}
}
return invoke;
}
/* JADX WARN: Type inference failed for: r2v1, types: [kotlin.collections.IntIterator] */
/* renamed from: minOfOrNull, reason: collision with other method in class */
private static final Double m6996minOfOrNull(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
double doubleValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).doubleValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
doubleValue = Math.min(doubleValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).doubleValue());
}
return Double.valueOf(doubleValue);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
/* renamed from: minOfOrNull, reason: collision with other method in class */
private static final Float m6997minOfOrNull(CharSequence charSequence, Function1<? super Character, Float> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
float floatValue = selector.invoke(Character.valueOf(charSequence.charAt(0))).floatValue();
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
floatValue = Math.min(floatValue, selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt()))).floatValue());
}
return Float.valueOf(floatValue);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R extends Comparable<? super R>> R minOfOrNull(CharSequence charSequence, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
R invoke = selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
R invoke2 = selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (invoke.compareTo(invoke2) > 0) {
invoke = invoke2;
}
}
return invoke;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R> R minOfWith(CharSequence charSequence, Comparator<? super R> comparator, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
Object obj = (R) selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
Object obj2 = (R) selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (comparator.compare(obj, obj2) > 0) {
obj = (R) obj2;
}
}
return (R) obj;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
private static final <R> R minOfWithOrNull(CharSequence charSequence, Comparator<? super R> comparator, Function1<? super Character, ? extends R> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
Intrinsics.checkNotNullParameter(selector, "selector");
if (charSequence.length() == 0) {
return null;
}
Object obj = (R) selector.invoke(Character.valueOf(charSequence.charAt(0)));
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
Object obj2 = (R) selector.invoke(Character.valueOf(charSequence.charAt(it.nextInt())));
if (comparator.compare(obj, obj2) > 0) {
obj = (R) obj2;
}
}
return (R) obj;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character minOrNull(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (Intrinsics.compare((int) charAt, (int) charAt2) > 0) {
charAt = charAt2;
}
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char minWithOrThrow(CharSequence charSequence, Comparator<? super Character> comparator) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
if (charSequence.length() == 0) {
throw new NoSuchElementException();
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (comparator.compare(Character.valueOf(charAt), Character.valueOf(charAt2)) > 0) {
charAt = charAt2;
}
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character minWithOrNull(CharSequence charSequence, Comparator<? super Character> comparator) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(comparator, "comparator");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
char charAt2 = charSequence.charAt(it.nextInt());
if (comparator.compare(Character.valueOf(charAt), Character.valueOf(charAt2)) > 0) {
charAt = charAt2;
}
}
return Character.valueOf(charAt);
}
public static final boolean none(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return charSequence.length() == 0;
}
public static final boolean none(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
if (predicate.invoke(Character.valueOf(charSequence.charAt(i))).booleanValue()) {
return false;
}
}
return true;
}
public static final <S extends CharSequence> S onEach(S s, Function1<? super Character, Unit> action) {
Intrinsics.checkNotNullParameter(s, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
for (int i = 0; i < s.length(); i++) {
action.invoke(Character.valueOf(s.charAt(i)));
}
return s;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char reduce(CharSequence charSequence, Function2<? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
throw new UnsupportedOperationException("Empty char sequence can't be reduced.");
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
charAt = operation.invoke(Character.valueOf(charAt), Character.valueOf(charSequence.charAt(it.nextInt()))).charValue();
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final char reduceIndexed(CharSequence charSequence, Function3<? super Integer, ? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
throw new UnsupportedOperationException("Empty char sequence can't be reduced.");
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
int nextInt = it.nextInt();
charAt = operation.invoke(Integer.valueOf(nextInt), Character.valueOf(charAt), Character.valueOf(charSequence.charAt(nextInt))).charValue();
}
return charAt;
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character reduceIndexedOrNull(CharSequence charSequence, Function3<? super Integer, ? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
int nextInt = it.nextInt();
charAt = operation.invoke(Integer.valueOf(nextInt), Character.valueOf(charAt), Character.valueOf(charSequence.charAt(nextInt))).charValue();
}
return Character.valueOf(charAt);
}
/* JADX WARN: Type inference failed for: r1v1, types: [kotlin.collections.IntIterator] */
public static final Character reduceOrNull(CharSequence charSequence, Function2<? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return null;
}
char charAt = charSequence.charAt(0);
?? it = new IntRange(1, StringsKt.getLastIndex(charSequence)).iterator();
while (it.hasNext()) {
charAt = operation.invoke(Character.valueOf(charAt), Character.valueOf(charSequence.charAt(it.nextInt()))).charValue();
}
return Character.valueOf(charAt);
}
public static final char reduceRight(CharSequence charSequence, Function2<? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex < 0) {
throw new UnsupportedOperationException("Empty char sequence can't be reduced.");
}
char charAt = charSequence.charAt(lastIndex);
for (int i = lastIndex - 1; i >= 0; i--) {
charAt = operation.invoke(Character.valueOf(charSequence.charAt(i)), Character.valueOf(charAt)).charValue();
}
return charAt;
}
public static final char reduceRightIndexed(CharSequence charSequence, Function3<? super Integer, ? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex < 0) {
throw new UnsupportedOperationException("Empty char sequence can't be reduced.");
}
char charAt = charSequence.charAt(lastIndex);
for (int i = lastIndex - 1; i >= 0; i--) {
charAt = operation.invoke(Integer.valueOf(i), Character.valueOf(charSequence.charAt(i)), Character.valueOf(charAt)).charValue();
}
return charAt;
}
public static final Character reduceRightIndexedOrNull(CharSequence charSequence, Function3<? super Integer, ? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex < 0) {
return null;
}
char charAt = charSequence.charAt(lastIndex);
for (int i = lastIndex - 1; i >= 0; i--) {
charAt = operation.invoke(Integer.valueOf(i), Character.valueOf(charSequence.charAt(i)), Character.valueOf(charAt)).charValue();
}
return Character.valueOf(charAt);
}
public static final Character reduceRightOrNull(CharSequence charSequence, Function2<? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
int lastIndex = StringsKt.getLastIndex(charSequence);
if (lastIndex < 0) {
return null;
}
char charAt = charSequence.charAt(lastIndex);
for (int i = lastIndex - 1; i >= 0; i--) {
charAt = operation.invoke(Character.valueOf(charSequence.charAt(i)), Character.valueOf(charAt)).charValue();
}
return Character.valueOf(charAt);
}
public static final <R> List<R> runningFold(CharSequence charSequence, R r, Function2<? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.listOf(r);
}
ArrayList arrayList = new ArrayList(charSequence.length() + 1);
arrayList.add(r);
for (int i = 0; i < charSequence.length(); i++) {
r = operation.invoke(r, Character.valueOf(charSequence.charAt(i)));
arrayList.add(r);
}
return arrayList;
}
public static final <R> List<R> runningFoldIndexed(CharSequence charSequence, R r, Function3<? super Integer, ? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.listOf(r);
}
ArrayList arrayList = new ArrayList(charSequence.length() + 1);
arrayList.add(r);
int length = charSequence.length();
for (int i = 0; i < length; i++) {
r = operation.invoke(Integer.valueOf(i), r, Character.valueOf(charSequence.charAt(i)));
arrayList.add(r);
}
return arrayList;
}
public static final List<Character> runningReduce(CharSequence charSequence, Function2<? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.emptyList();
}
char charAt = charSequence.charAt(0);
ArrayList arrayList = new ArrayList(charSequence.length());
arrayList.add(Character.valueOf(charAt));
int length = charSequence.length();
for (int i = 1; i < length; i++) {
charAt = operation.invoke(Character.valueOf(charAt), Character.valueOf(charSequence.charAt(i))).charValue();
arrayList.add(Character.valueOf(charAt));
}
return arrayList;
}
public static final List<Character> runningReduceIndexed(CharSequence charSequence, Function3<? super Integer, ? super Character, ? super Character, Character> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.emptyList();
}
char charAt = charSequence.charAt(0);
ArrayList arrayList = new ArrayList(charSequence.length());
arrayList.add(Character.valueOf(charAt));
int length = charSequence.length();
for (int i = 1; i < length; i++) {
charAt = operation.invoke(Integer.valueOf(i), Character.valueOf(charAt), Character.valueOf(charSequence.charAt(i))).charValue();
arrayList.add(Character.valueOf(charAt));
}
return arrayList;
}
@Deprecated(message = "Use sumOf instead.", replaceWith = @ReplaceWith(expression = "this.sumOf(selector)", imports = {}))
@DeprecatedSinceKotlin(warningSince = "1.5")
public static final int sumBy(CharSequence charSequence, Function1<? super Character, Integer> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
int i = 0;
for (int i2 = 0; i2 < charSequence.length(); i2++) {
i += selector.invoke(Character.valueOf(charSequence.charAt(i2))).intValue();
}
return i;
}
@Deprecated(message = "Use sumOf instead.", replaceWith = @ReplaceWith(expression = "this.sumOf(selector)", imports = {}))
@DeprecatedSinceKotlin(warningSince = "1.5")
public static final double sumByDouble(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
double d = BuildConfig.SENTRY_SAMPLE_RATE;
for (int i = 0; i < charSequence.length(); i++) {
d += selector.invoke(Character.valueOf(charSequence.charAt(i))).doubleValue();
}
return d;
}
private static final double sumOfDouble(CharSequence charSequence, Function1<? super Character, Double> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
double d = BuildConfig.SENTRY_SAMPLE_RATE;
for (int i = 0; i < charSequence.length(); i++) {
d += selector.invoke(Character.valueOf(charSequence.charAt(i))).doubleValue();
}
return d;
}
private static final int sumOfInt(CharSequence charSequence, Function1<? super Character, Integer> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
int i = 0;
for (int i2 = 0; i2 < charSequence.length(); i2++) {
i += selector.invoke(Character.valueOf(charSequence.charAt(i2))).intValue();
}
return i;
}
private static final long sumOfLong(CharSequence charSequence, Function1<? super Character, Long> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
long j = 0;
for (int i = 0; i < charSequence.length(); i++) {
j += selector.invoke(Character.valueOf(charSequence.charAt(i))).longValue();
}
return j;
}
private static final int sumOfUInt(CharSequence charSequence, Function1<? super Character, UInt> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
int m5793constructorimpl = UInt.m5793constructorimpl(0);
for (int i = 0; i < charSequence.length(); i++) {
m5793constructorimpl = UInt.m5793constructorimpl(m5793constructorimpl + selector.invoke(Character.valueOf(charSequence.charAt(i))).getData());
}
return m5793constructorimpl;
}
private static final long sumOfULong(CharSequence charSequence, Function1<? super Character, ULong> selector) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(selector, "selector");
long m5872constructorimpl = ULong.m5872constructorimpl(0L);
for (int i = 0; i < charSequence.length(); i++) {
m5872constructorimpl = ULong.m5872constructorimpl(m5872constructorimpl + selector.invoke(Character.valueOf(charSequence.charAt(i))).getData());
}
return m5872constructorimpl;
}
public static final List<String> chunked(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.windowed(charSequence, i, i, true);
}
public static final <R> List<R> chunked(CharSequence charSequence, int i, Function1<? super CharSequence, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
return StringsKt.windowed(charSequence, i, i, true, transform);
}
public static final Sequence<String> chunkedSequence(CharSequence charSequence, int i) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.chunkedSequence(charSequence, i, new Function1<CharSequence, String>() { // from class: kotlin.text.StringsKt___StringsKt$chunkedSequence$1
@Override // kotlin.jvm.functions.Function1
public final String invoke(CharSequence it) {
Intrinsics.checkNotNullParameter(it, "it");
return it.toString();
}
});
}
public static final <R> Sequence<R> chunkedSequence(CharSequence charSequence, int i, Function1<? super CharSequence, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
return StringsKt.windowedSequence(charSequence, i, i, true, transform);
}
public static final Pair<CharSequence, CharSequence> partition(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
StringBuilder sb = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
} else {
sb2.append(charAt);
}
}
return new Pair<>(sb, sb2);
}
public static final Pair<String, String> partition(String str, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(str, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
StringBuilder sb = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
int length = str.length();
for (int i = 0; i < length; i++) {
char charAt = str.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
sb.append(charAt);
} else {
sb2.append(charAt);
}
}
String sb3 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb3, "toString(...)");
String sb4 = sb2.toString();
Intrinsics.checkNotNullExpressionValue(sb4, "toString(...)");
return new Pair<>(sb3, sb4);
}
public static /* synthetic */ List windowed$default(CharSequence charSequence, int i, int i2, boolean z, int i3, Object obj) {
if ((i3 & 2) != 0) {
i2 = 1;
}
if ((i3 & 4) != 0) {
z = false;
}
return StringsKt.windowed(charSequence, i, i2, z);
}
public static final List<String> windowed(CharSequence charSequence, int i, int i2, boolean z) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.windowed(charSequence, i, i2, z, new Function1<CharSequence, String>() { // from class: kotlin.text.StringsKt___StringsKt$windowed$1
@Override // kotlin.jvm.functions.Function1
public final String invoke(CharSequence it) {
Intrinsics.checkNotNullParameter(it, "it");
return it.toString();
}
});
}
public static /* synthetic */ List windowed$default(CharSequence charSequence, int i, int i2, boolean z, Function1 function1, int i3, Object obj) {
if ((i3 & 2) != 0) {
i2 = 1;
}
if ((i3 & 4) != 0) {
z = false;
}
return StringsKt.windowed(charSequence, i, i2, z, function1);
}
public static final <R> List<R> windowed(CharSequence charSequence, int i, int i2, boolean z, Function1<? super CharSequence, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
SlidingWindowKt.checkWindowSizeStep(i, i2);
int length = charSequence.length();
int i3 = 0;
ArrayList arrayList = new ArrayList((length / i2) + (length % i2 == 0 ? 0 : 1));
while (i3 >= 0 && i3 < length) {
int i4 = i3 + i;
if (i4 < 0 || i4 > length) {
if (!z) {
break;
}
i4 = length;
}
arrayList.add(transform.invoke(charSequence.subSequence(i3, i4)));
i3 += i2;
}
return arrayList;
}
public static /* synthetic */ Sequence windowedSequence$default(CharSequence charSequence, int i, int i2, boolean z, int i3, Object obj) {
if ((i3 & 2) != 0) {
i2 = 1;
}
if ((i3 & 4) != 0) {
z = false;
}
return StringsKt.windowedSequence(charSequence, i, i2, z);
}
public static final Sequence<String> windowedSequence(CharSequence charSequence, int i, int i2, boolean z) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return StringsKt.windowedSequence(charSequence, i, i2, z, new Function1<CharSequence, String>() { // from class: kotlin.text.StringsKt___StringsKt$windowedSequence$1
@Override // kotlin.jvm.functions.Function1
public final String invoke(CharSequence it) {
Intrinsics.checkNotNullParameter(it, "it");
return it.toString();
}
});
}
public static /* synthetic */ Sequence windowedSequence$default(CharSequence charSequence, int i, int i2, boolean z, Function1 function1, int i3, Object obj) {
if ((i3 & 2) != 0) {
i2 = 1;
}
if ((i3 & 4) != 0) {
z = false;
}
return StringsKt.windowedSequence(charSequence, i, i2, z, function1);
}
public static final <R> Sequence<R> windowedSequence(final CharSequence charSequence, final int i, int i2, boolean z, final Function1<? super CharSequence, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
SlidingWindowKt.checkWindowSizeStep(i, i2);
return SequencesKt.map(CollectionsKt.asSequence(RangesKt.step(z ? StringsKt.getIndices(charSequence) : RangesKt.until(0, (charSequence.length() - i) + 1), i2)), new Function1<Integer, R>() { // from class: kotlin.text.StringsKt___StringsKt$windowedSequence$2
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Integer num) {
return invoke(num.intValue());
}
public final R invoke(int i3) {
int i4 = i + i3;
if (i4 < 0 || i4 > charSequence.length()) {
i4 = charSequence.length();
}
return transform.invoke(charSequence.subSequence(i3, i4));
}
});
}
public static final <V> List<V> zip(CharSequence charSequence, CharSequence other, Function2<? super Character, ? super Character, ? extends V> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(other, "other");
Intrinsics.checkNotNullParameter(transform, "transform");
int min = Math.min(charSequence.length(), other.length());
ArrayList arrayList = new ArrayList(min);
for (int i = 0; i < min; i++) {
arrayList.add(transform.invoke(Character.valueOf(charSequence.charAt(i)), Character.valueOf(other.charAt(i))));
}
return arrayList;
}
public static final <R> List<R> zipWithNext(CharSequence charSequence, Function2<? super Character, ? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(transform, "transform");
int length = charSequence.length() - 1;
if (length < 1) {
return CollectionsKt.emptyList();
}
ArrayList arrayList = new ArrayList(length);
int i = 0;
while (i < length) {
Character valueOf = Character.valueOf(charSequence.charAt(i));
i++;
arrayList.add(transform.invoke(valueOf, Character.valueOf(charSequence.charAt(i))));
}
return arrayList;
}
public static final Iterable<Character> asIterable(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return ((charSequence instanceof String) && charSequence.length() == 0) ? CollectionsKt.emptyList() : new StringsKt___StringsKt$asIterable$$inlined$Iterable$1(charSequence);
}
public static final Sequence<Character> asSequence(final CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
return ((charSequence instanceof String) && charSequence.length() == 0) ? SequencesKt.emptySequence() : new Sequence<Character>() { // from class: kotlin.text.StringsKt___StringsKt$asSequence$$inlined$Sequence$1
@Override // kotlin.sequences.Sequence
public Iterator<Character> iterator() {
return StringsKt.iterator(charSequence);
}
};
}
private static final Character find(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
for (int i = 0; i < charSequence.length(); i++) {
char charAt = charSequence.charAt(i);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
return Character.valueOf(charAt);
}
}
return null;
}
private static final Character findLast(CharSequence charSequence, Function1<? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int length = charSequence.length() - 1;
if (length >= 0) {
while (true) {
int i = length - 1;
char charAt = charSequence.charAt(length);
if (predicate.invoke(Character.valueOf(charAt)).booleanValue()) {
return Character.valueOf(charAt);
}
if (i < 0) {
break;
}
length = i;
}
}
return null;
}
public static final <C extends Appendable> C filterIndexedTo(CharSequence charSequence, C destination, Function2<? super Integer, ? super Character, Boolean> predicate) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(predicate, "predicate");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
char charAt = charSequence.charAt(i);
int i3 = i2 + 1;
if (predicate.invoke(Integer.valueOf(i2), Character.valueOf(charAt)).booleanValue()) {
destination.append(charAt);
}
i++;
i2 = i3;
}
return destination;
}
public static final <R, C extends Collection<? super R>> C mapIndexedNotNullTo(CharSequence charSequence, C destination, Function2<? super Integer, ? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
int i3 = i2 + 1;
R invoke = transform.invoke(Integer.valueOf(i2), Character.valueOf(charSequence.charAt(i)));
if (invoke != null) {
destination.add(invoke);
}
i++;
i2 = i3;
}
return destination;
}
public static final <R, C extends Collection<? super R>> C mapNotNullTo(CharSequence charSequence, C destination, Function1<? super Character, ? extends R> transform) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(destination, "destination");
Intrinsics.checkNotNullParameter(transform, "transform");
for (int i = 0; i < charSequence.length(); i++) {
R invoke = transform.invoke(Character.valueOf(charSequence.charAt(i)));
if (invoke != null) {
destination.add(invoke);
}
}
return destination;
}
public static final <S extends CharSequence> S onEachIndexed(S s, Function2<? super Integer, ? super Character, Unit> action) {
Intrinsics.checkNotNullParameter(s, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int i = 0;
int i2 = 0;
while (i < s.length()) {
action.invoke(Integer.valueOf(i2), Character.valueOf(s.charAt(i)));
i++;
i2++;
}
return s;
}
public static final <R> List<R> scan(CharSequence charSequence, R r, Function2<? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.listOf(r);
}
ArrayList arrayList = new ArrayList(charSequence.length() + 1);
arrayList.add(r);
for (int i = 0; i < charSequence.length(); i++) {
r = operation.invoke(r, Character.valueOf(charSequence.charAt(i)));
arrayList.add(r);
}
return arrayList;
}
public static final <R> List<R> scanIndexed(CharSequence charSequence, R r, Function3<? super Integer, ? super R, ? super Character, ? extends R> operation) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(operation, "operation");
if (charSequence.length() == 0) {
return CollectionsKt.listOf(r);
}
ArrayList arrayList = new ArrayList(charSequence.length() + 1);
arrayList.add(r);
int length = charSequence.length();
for (int i = 0; i < length; i++) {
r = operation.invoke(Integer.valueOf(i), r, Character.valueOf(charSequence.charAt(i)));
arrayList.add(r);
}
return arrayList;
}
public static final List<Pair<Character, Character>> zip(CharSequence charSequence, CharSequence other) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
Intrinsics.checkNotNullParameter(other, "other");
int min = Math.min(charSequence.length(), other.length());
ArrayList arrayList = new ArrayList(min);
for (int i = 0; i < min; i++) {
arrayList.add(TuplesKt.to(Character.valueOf(charSequence.charAt(i)), Character.valueOf(other.charAt(i))));
}
return arrayList;
}
public static final List<Pair<Character, Character>> zipWithNext(CharSequence charSequence) {
Intrinsics.checkNotNullParameter(charSequence, "<this>");
int length = charSequence.length() - 1;
if (length < 1) {
return CollectionsKt.emptyList();
}
ArrayList arrayList = new ArrayList(length);
int i = 0;
while (i < length) {
char charAt = charSequence.charAt(i);
i++;
arrayList.add(TuplesKt.to(Character.valueOf(charAt), Character.valueOf(charSequence.charAt(i))));
}
return arrayList;
}
}