* Decompile and recreate Soul Browser v1.4.85 with APK CI builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix CI build: include bundled google.jks and remove PR trigger The apktool build failed in CI because app/unknown/.../google.jks was excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files and commit the missing resource. Also remove the redundant pull_request workflow trigger. Co-authored-by: KaKi87 <KaKi87@pm.me> * Change package ID to com.github.kaki87.soulbrowser Rename the application ID so the rebuilt APK can be installed alongside the original Soul Browser from Google Play. - Update AndroidManifest package, permissions, providers, and actions - Update R class references in smali (com/github/kaki87/soulbrowser/R) - Update shortcuts.xml targetPackage - Rename app label to "Soul Rebuild" for easy identification Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install compatibility: remove split APK metadata and bundle native libs The rebuilt APK still declared requiredSplitTypes and Play Store split metadata, causing Android to reject standalone installs as incompatible. - Remove requiredSplitTypes and split-related manifest meta-data - Merge native libs from all ABI splits with uncompressed storage - Page-align before signing for extractNativeLibs=false - Add .so to apktool doNotCompress list Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install failure: use apksigner v2/v3 and bundle arm64 native libs Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only produces v1 signatures, causing Android to reject the install. - Sign with apksigner (v1+v2+v3) instead of jarsigner - Add arm64-v8a native libraries from universal Soul Browser 1.4.79 - Set extractNativeLibs=true for reliable sideload installs - Commit stable debug keystore for consistent signatures across builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Add committed debug keystore for consistent APK signatures Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix startup crash: use original classes2.dex desugar libraries Apktool recompiles smali_classes2 into a broken classes2.dex, causing ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init. Inject the original classes2.dex (Java 8+ desugar libs) after apktool build instead of using the recompiled version. Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix missing drawable resources from density split APKs The base APK is an app bundle module; density-specific drawables like seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild, causing Resources$NotFoundException at runtime. - Merge non-9-patch resources from split APKs before apktool build - Sync public.xml IDs from R smali only when backing files exist - Add 713 density-specific resource IDs to public.xml Co-authored-by: KaKi87 <KaKi87@pm.me> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1969 lines
102 KiB
Java
1969 lines
102 KiB
Java
package kotlin.text;
|
|
|
|
import com.google.android.gms.ads.RequestConfiguration;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import kotlin.Deprecated;
|
|
import kotlin.Metadata;
|
|
import kotlin.OverloadResolutionByLambdaReturnType;
|
|
import kotlin.Pair;
|
|
import kotlin.ReplaceWith;
|
|
import kotlin.SinceKotlin;
|
|
import kotlin.TuplesKt;
|
|
import kotlin.collections.ArraysKt;
|
|
import kotlin.collections.CharIterator;
|
|
import kotlin.collections.CollectionsKt;
|
|
import kotlin.collections.CollectionsKt___CollectionsKt;
|
|
import kotlin.internal.InlineOnly;
|
|
import kotlin.jvm.JvmName;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlin.ranges.IntProgression;
|
|
import kotlin.ranges.IntRange;
|
|
import kotlin.ranges.RangesKt;
|
|
import kotlin.sequences.Sequence;
|
|
import kotlin.sequences.SequencesKt;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
@Metadata(d1 = {"\u0000\u0080\u0001\n\u0000\n\u0002\u0010\r\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\f\n\u0002\u0010\u000b\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u0019\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0015\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001e\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\b\n\u001a$\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a$\u0010\u0000\u001a\u00020\u0006*\u00020\u00062\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a$\u0010\u0007\u001a\u00020\u0001*\u00020\u00012\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a$\u0010\u0007\u001a\u00020\u0006*\u00020\u00062\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a$\u0010\b\u001a\u00020\u0001*\u00020\u00012\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a$\u0010\b\u001a\u00020\u0006*\u00020\u00062\u0012\u0010\u0002\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003H\u0086\bø\u0001\u0000\u001a\u0016\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\u0016\u0010\u0000\u001a\u00020\u0006*\u00020\u00062\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\u0016\u0010\u0007\u001a\u00020\u0001*\u00020\u00012\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\u0016\u0010\u0007\u001a\u00020\u0006*\u00020\u00062\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\u0016\u0010\b\u001a\u00020\u0001*\u00020\u00012\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\u0016\u0010\b\u001a\u00020\u0006*\u00020\u00062\n\u0010\t\u001a\u00020\n\"\u00020\u0004\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0001\u001a\r\u0010\u0000\u001a\u00020\u0006*\u00020\u0006H\u0087\b\u001a\n\u0010\u0007\u001a\u00020\u0001*\u00020\u0001\u001a\r\u0010\u0007\u001a\u00020\u0006*\u00020\u0006H\u0087\b\u001a\n\u0010\b\u001a\u00020\u0001*\u00020\u0001\u001a\r\u0010\b\u001a\u00020\u0006*\u00020\u0006H\u0087\b\u001a\u001c\u0010\u000b\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\f\u001a\u00020\r2\b\b\u0002\u0010\u000e\u001a\u00020\u0004\u001a\u001c\u0010\u000b\u001a\u00020\u0006*\u00020\u00062\u0006\u0010\f\u001a\u00020\r2\b\b\u0002\u0010\u000e\u001a\u00020\u0004\u001a\u001c\u0010\u000f\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\f\u001a\u00020\r2\b\b\u0002\u0010\u000e\u001a\u00020\u0004\u001a\u001c\u0010\u000f\u001a\u00020\u0006*\u00020\u00062\u0006\u0010\f\u001a\u00020\r2\b\b\u0002\u0010\u000e\u001a\u00020\u0004\u001a \u0010\u0010\u001a\u00020\u0005*\u0004\u0018\u00010\u0001H\u0087\b\u0082\u0002\u000e\n\f\b\u0000\u0012\u0002\u0018\u0001\u001a\u0004\b\u0003\u0010\u0000\u001a\r\u0010\u0011\u001a\u00020\u0005*\u00020\u0001H\u0087\b\u001a\r\u0010\u0012\u001a\u00020\u0005*\u00020\u0001H\u0087\b\u001a\n\u0010\u0013\u001a\u00020\u0005*\u00020\u0001\u001a\r\u0010\u0014\u001a\u00020\u0005*\u00020\u0001H\u0087\b\u001a \u0010\u0015\u001a\u00020\u0005*\u0004\u0018\u00010\u0001H\u0087\b\u0082\u0002\u000e\n\f\b\u0000\u0012\u0002\u0018\u0001\u001a\u0004\b\u0003\u0010\u0000\u001a\r\u0010\u0016\u001a\u00020\u0017*\u00020\u0001H\u0086\u0002\u001a\u000f\u0010\u0018\u001a\u00020\u0006*\u0004\u0018\u00010\u0006H\u0087\b\u001aD\u0010\u0019\u001a\u0002H\u001a\"\f\b\u0000\u0010\u001b*\u00020\u0001*\u0002H\u001a\"\u0004\b\u0001\u0010\u001a*\u0002H\u001b2\f\u0010\u001c\u001a\b\u0012\u0004\u0012\u0002H\u001a0\u001dH\u0087\bø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0000¢\u0006\u0002\u0010\u001e\u001aD\u0010\u001f\u001a\u0002H\u001a\"\f\b\u0000\u0010\u001b*\u00020\u0001*\u0002H\u001a\"\u0004\b\u0001\u0010\u001a*\u0002H\u001b2\f\u0010\u001c\u001a\b\u0012\u0004\u0012\u0002H\u001a0\u001dH\u0087\bø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0000¢\u0006\u0002\u0010\u001e\u001a\u0012\u0010'\u001a\u00020\u0005*\u00020\u00012\u0006\u0010(\u001a\u00020\r\u001a\u0012\u0010)\u001a\u00020\u0006*\u00020\u00062\u0006\u0010*\u001a\u00020!\u001a\u0012\u0010+\u001a\u00020\u0001*\u00020\u00012\u0006\u0010*\u001a\u00020!\u001a\u001d\u0010+\u001a\u00020\u0001*\u00020\u00062\u0006\u0010,\u001a\u00020\r2\u0006\u0010-\u001a\u00020\rH\u0087\b\u001a\u001f\u0010)\u001a\u00020\u0006*\u00020\u00012\u0006\u0010.\u001a\u00020\r2\b\b\u0002\u0010/\u001a\u00020\rH\u0087\b\u001a\u0012\u0010)\u001a\u00020\u0006*\u00020\u00012\u0006\u0010*\u001a\u00020!\u001a\u001c\u00100\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00100\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00103\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00103\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00104\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00104\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00105\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001c\u00105\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a\"\u00106\u001a\u00020\u0001*\u00020\u00012\u0006\u0010.\u001a\u00020\r2\u0006\u0010/\u001a\u00020\r2\u0006\u00107\u001a\u00020\u0001\u001a%\u00106\u001a\u00020\u0006*\u00020\u00062\u0006\u0010.\u001a\u00020\r2\u0006\u0010/\u001a\u00020\r2\u0006\u00107\u001a\u00020\u0001H\u0087\b\u001a\u001a\u00106\u001a\u00020\u0001*\u00020\u00012\u0006\u0010*\u001a\u00020!2\u0006\u00107\u001a\u00020\u0001\u001a\u001d\u00106\u001a\u00020\u0006*\u00020\u00062\u0006\u0010*\u001a\u00020!2\u0006\u00107\u001a\u00020\u0001H\u0087\b\u001a\u001a\u00108\u001a\u00020\u0001*\u00020\u00012\u0006\u0010.\u001a\u00020\r2\u0006\u0010/\u001a\u00020\r\u001a\u001d\u00108\u001a\u00020\u0006*\u00020\u00062\u0006\u0010.\u001a\u00020\r2\u0006\u0010/\u001a\u00020\rH\u0087\b\u001a\u0012\u00108\u001a\u00020\u0001*\u00020\u00012\u0006\u0010*\u001a\u00020!\u001a\u0015\u00108\u001a\u00020\u0006*\u00020\u00062\u0006\u0010*\u001a\u00020!H\u0087\b\u001a\u0012\u00109\u001a\u00020\u0001*\u00020\u00012\u0006\u0010:\u001a\u00020\u0001\u001a\u0012\u00109\u001a\u00020\u0006*\u00020\u00062\u0006\u0010:\u001a\u00020\u0001\u001a\u0012\u0010;\u001a\u00020\u0001*\u00020\u00012\u0006\u0010<\u001a\u00020\u0001\u001a\u0012\u0010;\u001a\u00020\u0006*\u00020\u00062\u0006\u0010<\u001a\u00020\u0001\u001a\u001a\u0010=\u001a\u00020\u0001*\u00020\u00012\u0006\u0010:\u001a\u00020\u00012\u0006\u0010<\u001a\u00020\u0001\u001a\u001a\u0010=\u001a\u00020\u0006*\u00020\u00062\u0006\u0010:\u001a\u00020\u00012\u0006\u0010<\u001a\u00020\u0001\u001a\u0012\u0010=\u001a\u00020\u0001*\u00020\u00012\u0006\u00101\u001a\u00020\u0001\u001a\u0012\u0010=\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u0001\u001a$\u0010>\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010>\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010?\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010?\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010@\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010@\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010A\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00042\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a$\u0010A\u001a\u00020\u0006*\u00020\u00062\u0006\u00101\u001a\u00020\u00062\u0006\u00107\u001a\u00020\u00062\b\b\u0002\u00102\u001a\u00020\u0006\u001a\u001d\u0010B\u001a\u00020\u0006*\u00020\u00012\u0006\u0010C\u001a\u00020D2\u0006\u00107\u001a\u00020\u0006H\u0087\b\u001a.\u0010B\u001a\u00020\u0006*\u00020\u00012\u0006\u0010C\u001a\u00020D2\u0014\b\b\u0010E\u001a\u000e\u0012\u0004\u0012\u00020F\u0012\u0004\u0012\u00020\u00010\u0003H\u0087\bø\u0001\u0000\u001a\u001d\u0010G\u001a\u00020\u0006*\u00020\u00012\u0006\u0010C\u001a\u00020D2\u0006\u00107\u001a\u00020\u0006H\u0087\b\u001a)\u0010H\u001a\u00020\u0006*\u00020\u00062\u0012\u0010E\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00040\u0003H\u0087\bø\u0001\u0000¢\u0006\u0002\bI\u001a)\u0010H\u001a\u00020\u0006*\u00020\u00062\u0012\u0010E\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00010\u0003H\u0087\bø\u0001\u0000¢\u0006\u0002\bJ\u001a\u0015\u0010K\u001a\u00020\u0005*\u00020\u00012\u0006\u0010C\u001a\u00020DH\u0087\f\u001a4\u0010L\u001a\u00020\u0005*\u00020\u00012\u0006\u0010M\u001a\u00020\r2\u0006\u0010N\u001a\u00020\u00012\u0006\u0010O\u001a\u00020\r2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010P\u001a\u00020\u0005H\u0000\u001a\u001c\u0010Q\u001a\u00020\u0005*\u00020\u00012\u0006\u0010R\u001a\u00020\u00042\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001c\u0010S\u001a\u00020\u0005*\u00020\u00012\u0006\u0010R\u001a\u00020\u00042\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001c\u0010Q\u001a\u00020\u0005*\u00020\u00012\u0006\u0010:\u001a\u00020\u00012\b\b\u0002\u0010P\u001a\u00020\u0005\u001a$\u0010Q\u001a\u00020\u0005*\u00020\u00012\u0006\u0010:\u001a\u00020\u00012\u0006\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001c\u0010S\u001a\u00020\u0005*\u00020\u00012\u0006\u0010<\u001a\u00020\u00012\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001c\u0010T\u001a\u00020\u0006*\u00020\u00012\u0006\u0010N\u001a\u00020\u00012\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001c\u0010U\u001a\u00020\u0006*\u00020\u00012\u0006\u0010N\u001a\u00020\u00012\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010V\u001a\u00020\r*\u00020\u00012\u0006\u0010\t\u001a\u00020\n2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010W\u001a\u00020\r*\u00020\u00012\u0006\u0010\t\u001a\u00020\n2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a;\u0010X\u001a\u00020\r*\u00020\u00012\u0006\u0010N\u001a\u00020\u00012\u0006\u0010.\u001a\u00020\r2\u0006\u0010/\u001a\u00020\r2\u0006\u0010P\u001a\u00020\u00052\b\b\u0002\u0010Y\u001a\u00020\u0005H\u0002¢\u0006\u0002\bZ\u001aE\u0010[\u001a\u0010\u0012\u0004\u0012\u00020\r\u0012\u0004\u0012\u00020\u0006\u0018\u00010\\*\u00020\u00012\f\u0010]\u001a\b\u0012\u0004\u0012\u00020\u00060^2\u0006\u0010.\u001a\u00020\r2\u0006\u0010P\u001a\u00020\u00052\u0006\u0010Y\u001a\u00020\u0005H\u0002¢\u0006\u0002\b_\u001a:\u0010[\u001a\u0010\u0012\u0004\u0012\u00020\r\u0012\u0004\u0012\u00020\u0006\u0018\u00010\\*\u00020\u00012\f\u0010]\u001a\b\u0012\u0004\u0012\u00020\u00060^2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a:\u0010`\u001a\u0010\u0012\u0004\u0012\u00020\r\u0012\u0004\u0012\u00020\u0006\u0018\u00010\\*\u00020\u00012\f\u0010]\u001a\b\u0012\u0004\u0012\u00020\u00060^2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a,\u0010V\u001a\u00020\r*\u00020\u00012\f\u0010]\u001a\b\u0012\u0004\u0012\u00020\u00060^2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a,\u0010W\u001a\u00020\r*\u00020\u00012\f\u0010]\u001a\b\u0012\u0004\u0012\u00020\u00060^2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010X\u001a\u00020\r*\u00020\u00012\u0006\u0010R\u001a\u00020\u00042\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010X\u001a\u00020\r*\u00020\u00012\u0006\u0010a\u001a\u00020\u00062\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010b\u001a\u00020\r*\u00020\u00012\u0006\u0010R\u001a\u00020\u00042\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a&\u0010b\u001a\u00020\r*\u00020\u00012\u0006\u0010a\u001a\u00020\u00062\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u0005\u001a\u001f\u0010c\u001a\u00020\u0005*\u00020\u00012\u0006\u0010N\u001a\u00020\u00012\b\b\u0002\u0010P\u001a\u00020\u0005H\u0086\u0002\u001a\u001f\u0010c\u001a\u00020\u0005*\u00020\u00012\u0006\u0010R\u001a\u00020\u00042\b\b\u0002\u0010P\u001a\u00020\u0005H\u0086\u0002\u001a\u0015\u0010c\u001a\u00020\u0005*\u00020\u00012\u0006\u0010C\u001a\u00020DH\u0087\n\u001a=\u0010d\u001a\b\u0012\u0004\u0012\u00020!0e*\u00020\u00012\u0006\u0010f\u001a\u00020\n2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\rH\u0002¢\u0006\u0002\bh\u001aG\u0010d\u001a\b\u0012\u0004\u0012\u00020!0e*\u00020\u00012\u000e\u0010f\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060i2\b\b\u0002\u0010.\u001a\u00020\r2\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\rH\u0002¢\u0006\u0004\bh\u0010j\u001a\u0010\u0010k\u001a\u00020l2\u0006\u0010g\u001a\u00020\rH\u0000\u001a=\u0010m\u001a\b\u0012\u0004\u0012\u00020\u00060e*\u00020\u00012\u0012\u0010f\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060i\"\u00020\u00062\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\r¢\u0006\u0002\u0010n\u001a=\u0010o\u001a\b\u0012\u0004\u0012\u00020\u00060p*\u00020\u00012\u0012\u0010f\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060i\"\u00020\u00062\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\r¢\u0006\u0002\u0010q\u001a0\u0010m\u001a\b\u0012\u0004\u0012\u00020\u00060e*\u00020\u00012\n\u0010f\u001a\u00020\n\"\u00020\u00042\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\r\u001a0\u0010o\u001a\b\u0012\u0004\u0012\u00020\u00060p*\u00020\u00012\n\u0010f\u001a\u00020\n\"\u00020\u00042\b\b\u0002\u0010P\u001a\u00020\u00052\b\b\u0002\u0010g\u001a\u00020\r\u001a/\u0010o\u001a\b\u0012\u0004\u0012\u00020\u00060p*\u00020\u00012\u0006\u00101\u001a\u00020\u00062\u0006\u0010P\u001a\u00020\u00052\u0006\u0010g\u001a\u00020\rH\u0002¢\u0006\u0002\br\u001a%\u0010o\u001a\b\u0012\u0004\u0012\u00020\u00060p*\u00020\u00012\u0006\u0010C\u001a\u00020D2\b\b\u0002\u0010g\u001a\u00020\rH\u0087\b\u001a%\u0010m\u001a\b\u0012\u0004\u0012\u00020\u00060e*\u00020\u00012\u0006\u0010C\u001a\u00020D2\b\b\u0002\u0010g\u001a\u00020\rH\u0087\b\u001a\u0010\u0010s\u001a\b\u0012\u0004\u0012\u00020\u00060e*\u00020\u0001\u001a\u0010\u0010t\u001a\b\u0012\u0004\u0012\u00020\u00060p*\u00020\u0001\u001a\u0018\u0010u\u001a\u00020\u0005*\u0004\u0018\u00010\u00012\b\u0010N\u001a\u0004\u0018\u00010\u0001H\u0000\u001a\u0018\u0010v\u001a\u00020\u0005*\u0004\u0018\u00010\u00012\b\u0010N\u001a\u0004\u0018\u00010\u0001H\u0000\u001a\f\u0010w\u001a\u00020\u0005*\u00020\u0006H\u0007\u001a\u0013\u0010x\u001a\u0004\u0018\u00010\u0005*\u00020\u0006H\u0007¢\u0006\u0002\u0010y\"\u0015\u0010 \u001a\u00020!*\u00020\u00018F¢\u0006\u0006\u001a\u0004\b\"\u0010#\"\u0015\u0010$\u001a\u00020\r*\u00020\u00018F¢\u0006\u0006\u001a\u0004\b%\u0010&\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006z"}, d2 = {"trim", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "predicate", "Lkotlin/Function1;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "trimStart", "trimEnd", "chars", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "padStart", "length", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "padChar", "padEnd", "isNullOrEmpty", "isEmpty", "isNotEmpty", "isBlank", "isNotBlank", "isNullOrBlank", "iterator", "Lkotlin/collections/CharIterator;", "orEmpty", "ifEmpty", "R", "C", "defaultValue", "Lkotlin/Function0;", "(Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "ifBlank", "indices", "Lkotlin/ranges/IntRange;", "getIndices", "(Ljava/lang/CharSequence;)Lkotlin/ranges/IntRange;", "lastIndex", "getLastIndex", "(Ljava/lang/CharSequence;)I", "hasSurrogatePairAt", "index", "substring", "range", "subSequence", "start", "end", "startIndex", "endIndex", "substringBefore", "delimiter", "missingDelimiterValue", "substringAfter", "substringBeforeLast", "substringAfterLast", "replaceRange", "replacement", "removeRange", "removePrefix", "prefix", "removeSuffix", "suffix", "removeSurrounding", "replaceBefore", "replaceAfter", "replaceAfterLast", "replaceBeforeLast", "replace", "regex", "Lkotlin/text/Regex;", "transform", "Lkotlin/text/MatchResult;", "replaceFirst", "replaceFirstChar", "replaceFirstCharWithChar", "replaceFirstCharWithCharSequence", "matches", "regionMatchesImpl", "thisOffset", "other", "otherOffset", "ignoreCase", "startsWith", "char", "endsWith", "commonPrefixWith", "commonSuffixWith", "indexOfAny", "lastIndexOfAny", "indexOf", "last", "indexOf$StringsKt__StringsKt", "findAnyOf", "Lkotlin/Pair;", "strings", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "findAnyOf$StringsKt__StringsKt", "findLastAnyOf", "string", "lastIndexOf", "contains", "rangesDelimitedBy", "Lkotlin/sequences/Sequence;", "delimiters", "limit", "rangesDelimitedBy$StringsKt__StringsKt", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "(Ljava/lang/CharSequence;[Ljava/lang/String;IZI)Lkotlin/sequences/Sequence;", "requireNonNegativeLimit", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "splitToSequence", "(Ljava/lang/CharSequence;[Ljava/lang/String;ZI)Lkotlin/sequences/Sequence;", "split", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "(Ljava/lang/CharSequence;[Ljava/lang/String;ZI)Ljava/util/List;", "split$StringsKt__StringsKt", "lineSequence", "lines", "contentEqualsIgnoreCaseImpl", "contentEqualsImpl", "toBooleanStrict", "toBooleanStrictOrNull", "(Ljava/lang/String;)Ljava/lang/Boolean;", "kotlin-stdlib"}, k = 5, mv = {2, 2, 0}, xi = 49, xs = "kotlin/text/StringsKt")
|
|
@SourceDebugExtension({"SMAP\nStrings.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Strings.kt\nkotlin/text/StringsKt__StringsKt\n+ 2 _Strings.kt\nkotlin/text/StringsKt___StringsKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 5 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,1580:1\n78#1,22:1581\n112#1,5:1603\n129#1,5:1608\n78#1,22:1613\n106#1:1635\n78#1,22:1636\n112#1,5:1658\n123#1:1663\n112#1,5:1664\n129#1,5:1669\n140#1:1674\n129#1,5:1675\n78#1,22:1680\n112#1,5:1702\n129#1,5:1707\n1069#2,2:1712\n13050#3,2:1714\n13050#3,2:1716\n295#4,2:1718\n295#4,2:1720\n1563#4:1723\n1634#4,3:1724\n1563#4:1727\n1634#4,3:1728\n1#5:1722\n*S KotlinDebug\n*F\n+ 1 Strings.kt\nkotlin/text/StringsKt__StringsKt\n*L\n106#1:1581,22\n123#1:1603,5\n140#1:1608,5\n145#1:1613,22\n150#1:1635\n150#1:1636,22\n155#1:1658,5\n160#1:1663\n160#1:1664,5\n165#1:1669,5\n170#1:1674\n170#1:1675,5\n175#1:1680,22\n186#1:1702,5\n197#1:1707,5\n310#1:1712,2\n967#1:1714,2\n991#1:1716,2\n1030#1:1718,2\n1036#1:1720,2\n1401#1:1723\n1401#1:1724,3\n1427#1:1727\n1427#1:1728,3\n*E\n"})
|
|
/* loaded from: classes4.dex */
|
|
public class StringsKt__StringsKt extends StringsKt__StringsJVMKt {
|
|
@NotNull
|
|
public static final String commonPrefixWith(@NotNull CharSequence charSequence, @NotNull CharSequence other, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
int min = Math.min(charSequence.length(), other.length());
|
|
int i = 0;
|
|
while (i < min && CharsKt__CharKt.equals(charSequence.charAt(i), other.charAt(i), z)) {
|
|
i++;
|
|
}
|
|
int i2 = i - 1;
|
|
if (hasSurrogatePairAt(charSequence, i2) || hasSurrogatePairAt(other, i2)) {
|
|
i--;
|
|
}
|
|
return charSequence.subSequence(0, i).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String commonPrefixWith$default(CharSequence charSequence, CharSequence charSequence2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return commonPrefixWith(charSequence, charSequence2, z);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String commonSuffixWith(@NotNull CharSequence charSequence, @NotNull CharSequence other, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
int length = charSequence.length();
|
|
int min = Math.min(length, other.length());
|
|
int i = 0;
|
|
while (i < min && CharsKt__CharKt.equals(charSequence.charAt((length - i) - 1), other.charAt((r1 - i) - 1), z)) {
|
|
i++;
|
|
}
|
|
if (hasSurrogatePairAt(charSequence, (length - i) - 1) || hasSurrogatePairAt(other, (r1 - i) - 1)) {
|
|
i--;
|
|
}
|
|
return charSequence.subSequence(length - i, length).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String commonSuffixWith$default(CharSequence charSequence, CharSequence charSequence2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return commonSuffixWith(charSequence, charSequence2, z);
|
|
}
|
|
|
|
public static final boolean contains(@NotNull CharSequence charSequence, @NotNull CharSequence other, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
return other instanceof String ? indexOf$default(charSequence, (String) other, 0, z, 2, (Object) null) >= 0 : indexOf$StringsKt__StringsKt$default(charSequence, other, 0, charSequence.length(), z, false, 16, null) >= 0;
|
|
}
|
|
|
|
public static /* synthetic */ boolean contains$default(CharSequence charSequence, CharSequence charSequence2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return contains(charSequence, charSequence2, z);
|
|
}
|
|
|
|
public static final boolean contentEqualsIgnoreCaseImpl(@Nullable CharSequence charSequence, @Nullable CharSequence charSequence2) {
|
|
if ((charSequence instanceof String) && (charSequence2 instanceof String)) {
|
|
return StringsKt__StringsJVMKt.equals((String) charSequence, (String) charSequence2, true);
|
|
}
|
|
if (charSequence == charSequence2) {
|
|
return true;
|
|
}
|
|
if (charSequence == null || charSequence2 == null || charSequence.length() != charSequence2.length()) {
|
|
return false;
|
|
}
|
|
int length = charSequence.length();
|
|
for (int i = 0; i < length; i++) {
|
|
if (!CharsKt__CharKt.equals(charSequence.charAt(i), charSequence2.charAt(i), true)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static final boolean contentEqualsImpl(@Nullable CharSequence charSequence, @Nullable CharSequence charSequence2) {
|
|
if ((charSequence instanceof String) && (charSequence2 instanceof String)) {
|
|
return Intrinsics.areEqual(charSequence, charSequence2);
|
|
}
|
|
if (charSequence == charSequence2) {
|
|
return true;
|
|
}
|
|
if (charSequence == null || charSequence2 == null || charSequence.length() != charSequence2.length()) {
|
|
return false;
|
|
}
|
|
int length = charSequence.length();
|
|
for (int i = 0; i < length; i++) {
|
|
if (charSequence.charAt(i) != charSequence2.charAt(i)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static final boolean endsWith(@NotNull CharSequence charSequence, char c2, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return charSequence.length() > 0 && CharsKt__CharKt.equals(charSequence.charAt(getLastIndex(charSequence)), c2, z);
|
|
}
|
|
|
|
public static /* synthetic */ boolean endsWith$default(CharSequence charSequence, char c2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return endsWith(charSequence, c2, z);
|
|
}
|
|
|
|
@Nullable
|
|
public static final Pair<Integer, String> findAnyOf(@NotNull CharSequence charSequence, @NotNull Collection<String> strings, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(strings, "strings");
|
|
return findAnyOf$StringsKt__StringsKt(charSequence, strings, i, z, false);
|
|
}
|
|
|
|
private static final Pair<Integer, String> findAnyOf$StringsKt__StringsKt(CharSequence charSequence, Collection<String> collection, int i, boolean z, boolean z2) {
|
|
IntProgression downTo;
|
|
CharSequence charSequence2;
|
|
Object obj;
|
|
boolean z3;
|
|
Object obj2;
|
|
Object single;
|
|
int lastIndexOf$default;
|
|
if (!z && collection.size() == 1) {
|
|
single = CollectionsKt___CollectionsKt.single(collection);
|
|
String str = (String) single;
|
|
if (!z2) {
|
|
lastIndexOf$default = indexOf$default(charSequence, str, i, false, 4, (Object) null);
|
|
} else {
|
|
lastIndexOf$default = lastIndexOf$default(charSequence, str, i, false, 4, (Object) null);
|
|
}
|
|
if (lastIndexOf$default >= 0) {
|
|
return TuplesKt.to(Integer.valueOf(lastIndexOf$default), str);
|
|
}
|
|
} else {
|
|
CharSequence charSequence3 = charSequence;
|
|
if (!z2) {
|
|
downTo = new IntRange(RangesKt.coerceAtLeast(i, 0), charSequence3.length());
|
|
} else {
|
|
downTo = RangesKt.downTo(RangesKt.coerceAtMost(i, getLastIndex(charSequence3)), 0);
|
|
}
|
|
if (charSequence3 instanceof String) {
|
|
int first = downTo.getFirst();
|
|
int last = downTo.getLast();
|
|
int step = downTo.getStep();
|
|
if ((step > 0 && first <= last) || (step < 0 && last <= first)) {
|
|
int i2 = first;
|
|
while (true) {
|
|
Iterator<T> it = collection.iterator();
|
|
while (true) {
|
|
if (it.hasNext()) {
|
|
obj2 = it.next();
|
|
String str2 = (String) obj2;
|
|
z3 = z;
|
|
if (StringsKt__StringsJVMKt.regionMatches(str2, 0, (String) charSequence3, i2, str2.length(), z3)) {
|
|
break;
|
|
}
|
|
z = z3;
|
|
} else {
|
|
z3 = z;
|
|
obj2 = null;
|
|
break;
|
|
}
|
|
}
|
|
String str3 = (String) obj2;
|
|
if (str3 != null) {
|
|
return TuplesKt.to(Integer.valueOf(i2), str3);
|
|
}
|
|
if (i2 == last) {
|
|
break;
|
|
}
|
|
i2 += step;
|
|
z = z3;
|
|
}
|
|
}
|
|
} else {
|
|
boolean z4 = z;
|
|
int first2 = downTo.getFirst();
|
|
int last2 = downTo.getLast();
|
|
int step2 = downTo.getStep();
|
|
if ((step2 > 0 && first2 <= last2) || (step2 < 0 && last2 <= first2)) {
|
|
int i3 = first2;
|
|
while (true) {
|
|
Iterator<T> it2 = collection.iterator();
|
|
while (true) {
|
|
if (it2.hasNext()) {
|
|
obj = it2.next();
|
|
String str4 = (String) obj;
|
|
boolean z5 = z4;
|
|
charSequence2 = charSequence3;
|
|
z4 = z5;
|
|
if (regionMatchesImpl(str4, 0, charSequence2, i3, str4.length(), z5)) {
|
|
break;
|
|
}
|
|
charSequence3 = charSequence2;
|
|
} else {
|
|
charSequence2 = charSequence3;
|
|
obj = null;
|
|
break;
|
|
}
|
|
}
|
|
String str5 = (String) obj;
|
|
if (str5 != null) {
|
|
return TuplesKt.to(Integer.valueOf(i3), str5);
|
|
}
|
|
if (i3 == last2) {
|
|
break;
|
|
}
|
|
i3 += step2;
|
|
charSequence3 = charSequence2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static /* synthetic */ Pair findAnyOf$default(CharSequence charSequence, Collection collection, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return findAnyOf(charSequence, collection, i, z);
|
|
}
|
|
|
|
@Nullable
|
|
public static final Pair<Integer, String> findLastAnyOf(@NotNull CharSequence charSequence, @NotNull Collection<String> strings, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(strings, "strings");
|
|
return findAnyOf$StringsKt__StringsKt(charSequence, strings, i, z, true);
|
|
}
|
|
|
|
public static /* synthetic */ Pair findLastAnyOf$default(CharSequence charSequence, Collection collection, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = getLastIndex(charSequence);
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return findLastAnyOf(charSequence, collection, i, z);
|
|
}
|
|
|
|
@NotNull
|
|
public static final IntRange getIndices(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return new IntRange(0, charSequence.length() - 1);
|
|
}
|
|
|
|
public static final int getLastIndex(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return charSequence.length() - 1;
|
|
}
|
|
|
|
public static final boolean hasSurrogatePairAt(@NotNull CharSequence charSequence, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (i >= 0 && i <= charSequence.length() - 2 && Character.isHighSurrogate(charSequence.charAt(i)) && Character.isLowSurrogate(charSequence.charAt(i + 1))) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@SinceKotlin(version = "1.3")
|
|
@InlineOnly
|
|
private static final <C extends CharSequence & R, R> R ifBlank(C c2, Function0<? extends R> defaultValue) {
|
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
|
if (isBlank(c2)) {
|
|
return defaultValue.invoke();
|
|
}
|
|
return c2;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@SinceKotlin(version = "1.3")
|
|
@InlineOnly
|
|
private static final <C extends CharSequence & R, R> R ifEmpty(C c2, Function0<? extends R> defaultValue) {
|
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
|
if (c2.length() == 0) {
|
|
return defaultValue.invoke();
|
|
}
|
|
return c2;
|
|
}
|
|
|
|
public static final int indexOf(@NotNull CharSequence charSequence, char c2, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return (z || !(charSequence instanceof String)) ? indexOfAny(charSequence, new char[]{c2}, i, z) : ((String) charSequence).indexOf(c2, i);
|
|
}
|
|
|
|
private static final int indexOf$StringsKt__StringsKt(CharSequence charSequence, CharSequence charSequence2, int i, int i2, boolean z, boolean z2) {
|
|
IntProgression downTo;
|
|
if (!z2) {
|
|
downTo = new IntRange(RangesKt.coerceAtLeast(i, 0), RangesKt.coerceAtMost(i2, charSequence.length()));
|
|
} else {
|
|
downTo = RangesKt.downTo(RangesKt.coerceAtMost(i, getLastIndex(charSequence)), RangesKt.coerceAtLeast(i2, 0));
|
|
}
|
|
if ((charSequence instanceof String) && (charSequence2 instanceof String)) {
|
|
int first = downTo.getFirst();
|
|
int last = downTo.getLast();
|
|
int step = downTo.getStep();
|
|
if ((step > 0 && first <= last) || (step < 0 && last <= first)) {
|
|
int i3 = first;
|
|
while (true) {
|
|
String str = (String) charSequence2;
|
|
boolean z3 = z;
|
|
if (StringsKt__StringsJVMKt.regionMatches(str, 0, (String) charSequence, i3, str.length(), z3)) {
|
|
return i3;
|
|
}
|
|
if (i3 != last) {
|
|
i3 += step;
|
|
z = z3;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
} else {
|
|
return -1;
|
|
}
|
|
} else {
|
|
boolean z4 = z;
|
|
int first2 = downTo.getFirst();
|
|
int last2 = downTo.getLast();
|
|
int step2 = downTo.getStep();
|
|
if ((step2 > 0 && first2 <= last2) || (step2 < 0 && last2 <= first2)) {
|
|
int i4 = first2;
|
|
while (true) {
|
|
boolean z5 = z4;
|
|
CharSequence charSequence3 = charSequence;
|
|
CharSequence charSequence4 = charSequence2;
|
|
z4 = z5;
|
|
if (regionMatchesImpl(charSequence4, 0, charSequence3, i4, charSequence2.length(), z5)) {
|
|
return i4;
|
|
}
|
|
if (i4 != last2) {
|
|
i4 += step2;
|
|
charSequence2 = charSequence4;
|
|
charSequence = charSequence3;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ int indexOf$StringsKt__StringsKt$default(CharSequence charSequence, CharSequence charSequence2, int i, int i2, boolean z, boolean z2, int i3, Object obj) {
|
|
if ((i3 & 16) != 0) {
|
|
z2 = false;
|
|
}
|
|
return indexOf$StringsKt__StringsKt(charSequence, charSequence2, i, i2, z, z2);
|
|
}
|
|
|
|
public static /* synthetic */ int indexOf$default(CharSequence charSequence, char c2, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return indexOf(charSequence, c2, i, z);
|
|
}
|
|
|
|
public static final int indexOfAny(@NotNull CharSequence charSequence, @NotNull char[] chars, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
if (!z && chars.length == 1 && (charSequence instanceof String)) {
|
|
return ((String) charSequence).indexOf(ArraysKt.single(chars), i);
|
|
}
|
|
int coerceAtLeast = RangesKt.coerceAtLeast(i, 0);
|
|
int lastIndex = getLastIndex(charSequence);
|
|
if (coerceAtLeast > lastIndex) {
|
|
return -1;
|
|
}
|
|
while (true) {
|
|
char charAt = charSequence.charAt(coerceAtLeast);
|
|
for (char c2 : chars) {
|
|
if (CharsKt__CharKt.equals(c2, charAt, z)) {
|
|
return coerceAtLeast;
|
|
}
|
|
}
|
|
if (coerceAtLeast == lastIndex) {
|
|
return -1;
|
|
}
|
|
coerceAtLeast++;
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ int indexOfAny$default(CharSequence charSequence, char[] cArr, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return indexOfAny(charSequence, cArr, i, z);
|
|
}
|
|
|
|
public static boolean isBlank(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
for (int i = 0; i < charSequence.length(); i++) {
|
|
if (!CharsKt__CharJVMKt.isWhitespace(charSequence.charAt(i))) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean isEmpty(CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (charSequence.length() == 0) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean isNotBlank(CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return !isBlank(charSequence);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean isNotEmpty(CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (charSequence.length() > 0) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean isNullOrBlank(CharSequence charSequence) {
|
|
if (charSequence != null && !isBlank(charSequence)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean isNullOrEmpty(CharSequence charSequence) {
|
|
if (charSequence != null && charSequence.length() != 0) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharIterator iterator(@NotNull final CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return new CharIterator() { // from class: kotlin.text.StringsKt__StringsKt$iterator$1
|
|
private int index;
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
if (this.index < charSequence.length()) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // kotlin.collections.CharIterator
|
|
public char nextChar() {
|
|
CharSequence charSequence2 = charSequence;
|
|
int i = this.index;
|
|
this.index = i + 1;
|
|
return charSequence2.charAt(i);
|
|
}
|
|
};
|
|
}
|
|
|
|
public static final int lastIndexOf(@NotNull CharSequence charSequence, char c2, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return (z || !(charSequence instanceof String)) ? lastIndexOfAny(charSequence, new char[]{c2}, i, z) : ((String) charSequence).lastIndexOf(c2, i);
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOf$default(CharSequence charSequence, char c2, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = getLastIndex(charSequence);
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return lastIndexOf(charSequence, c2, i, z);
|
|
}
|
|
|
|
public static final int lastIndexOfAny(@NotNull CharSequence charSequence, @NotNull char[] chars, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
if (!z && chars.length == 1 && (charSequence instanceof String)) {
|
|
return ((String) charSequence).lastIndexOf(ArraysKt.single(chars), i);
|
|
}
|
|
for (int coerceAtMost = RangesKt.coerceAtMost(i, getLastIndex(charSequence)); -1 < coerceAtMost; coerceAtMost--) {
|
|
char charAt = charSequence.charAt(coerceAtMost);
|
|
for (char c2 : chars) {
|
|
if (CharsKt__CharKt.equals(c2, charAt, z)) {
|
|
return coerceAtMost;
|
|
}
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOfAny$default(CharSequence charSequence, char[] cArr, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = getLastIndex(charSequence);
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return lastIndexOfAny(charSequence, cArr, i, z);
|
|
}
|
|
|
|
@NotNull
|
|
public static final Sequence<String> lineSequence(@NotNull final CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return new Sequence<String>() { // from class: kotlin.text.StringsKt__StringsKt$lineSequence$$inlined$Sequence$1
|
|
@Override // kotlin.sequences.Sequence
|
|
public Iterator<String> iterator() {
|
|
return new LinesIterator(charSequence);
|
|
}
|
|
};
|
|
}
|
|
|
|
@NotNull
|
|
public static final List<String> lines(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return SequencesKt.toList(lineSequence(charSequence));
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean matches(CharSequence charSequence, Regex regex) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.matches(charSequence);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String orEmpty(String str) {
|
|
if (str == null) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence padEnd(@NotNull CharSequence charSequence, int i, char c2) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (i >= 0) {
|
|
if (i <= charSequence.length()) {
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
StringBuilder sb = new StringBuilder(i);
|
|
sb.append(charSequence);
|
|
int length = i - charSequence.length();
|
|
int i2 = 1;
|
|
if (1 <= length) {
|
|
while (true) {
|
|
sb.append(c2);
|
|
if (i2 == length) {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
}
|
|
return sb;
|
|
}
|
|
throw new IllegalArgumentException(android.support.v4.media.a.f(i, "Desired length ", " is less than zero."));
|
|
}
|
|
|
|
public static /* synthetic */ CharSequence padEnd$default(CharSequence charSequence, int i, char c2, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
c2 = ' ';
|
|
}
|
|
return padEnd(charSequence, i, c2);
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence padStart(@NotNull CharSequence charSequence, int i, char c2) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (i >= 0) {
|
|
if (i <= charSequence.length()) {
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
StringBuilder sb = new StringBuilder(i);
|
|
int length = i - charSequence.length();
|
|
int i2 = 1;
|
|
if (1 <= length) {
|
|
while (true) {
|
|
sb.append(c2);
|
|
if (i2 == length) {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
}
|
|
sb.append(charSequence);
|
|
return sb;
|
|
}
|
|
throw new IllegalArgumentException(android.support.v4.media.a.f(i, "Desired length ", " is less than zero."));
|
|
}
|
|
|
|
public static /* synthetic */ CharSequence padStart$default(CharSequence charSequence, int i, char c2, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
c2 = ' ';
|
|
}
|
|
return padStart(charSequence, i, c2);
|
|
}
|
|
|
|
private static final Sequence<IntRange> rangesDelimitedBy$StringsKt__StringsKt(CharSequence charSequence, char[] cArr, int i, boolean z, int i2) {
|
|
requireNonNegativeLimit(i2);
|
|
return new DelimitedRangesSequence(charSequence, i, i2, new f(cArr, z, 0));
|
|
}
|
|
|
|
public static /* synthetic */ Sequence rangesDelimitedBy$StringsKt__StringsKt$default(CharSequence charSequence, char[] cArr, int i, boolean z, int i2, int i3, Object obj) {
|
|
if ((i3 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i3 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i3 & 8) != 0) {
|
|
i2 = 0;
|
|
}
|
|
return rangesDelimitedBy$StringsKt__StringsKt(charSequence, cArr, i, z, i2);
|
|
}
|
|
|
|
public static final Pair rangesDelimitedBy$lambda$0$StringsKt__StringsKt(char[] cArr, boolean z, CharSequence DelimitedRangesSequence, int i) {
|
|
Intrinsics.checkNotNullParameter(DelimitedRangesSequence, "$this$DelimitedRangesSequence");
|
|
int indexOfAny = indexOfAny(DelimitedRangesSequence, cArr, i, z);
|
|
if (indexOfAny < 0) {
|
|
return null;
|
|
}
|
|
return TuplesKt.to(Integer.valueOf(indexOfAny), 1);
|
|
}
|
|
|
|
public static final Pair rangesDelimitedBy$lambda$1$StringsKt__StringsKt(List list, boolean z, CharSequence DelimitedRangesSequence, int i) {
|
|
Intrinsics.checkNotNullParameter(DelimitedRangesSequence, "$this$DelimitedRangesSequence");
|
|
Pair<Integer, String> findAnyOf$StringsKt__StringsKt = findAnyOf$StringsKt__StringsKt(DelimitedRangesSequence, list, i, z, false);
|
|
if (findAnyOf$StringsKt__StringsKt != null) {
|
|
return TuplesKt.to(findAnyOf$StringsKt__StringsKt.getFirst(), Integer.valueOf(findAnyOf$StringsKt__StringsKt.getSecond().length()));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static final boolean regionMatchesImpl(@NotNull CharSequence charSequence, int i, @NotNull CharSequence other, int i2, int i3, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
if (i2 < 0 || i < 0 || i > charSequence.length() - i3 || i2 > other.length() - i3) {
|
|
return false;
|
|
}
|
|
for (int i4 = 0; i4 < i3; i4++) {
|
|
if (!CharsKt__CharKt.equals(charSequence.charAt(i + i4), other.charAt(i2 + i4), z)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removePrefix(@NotNull CharSequence charSequence, @NotNull CharSequence prefix) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
if (startsWith$default(charSequence, prefix, false, 2, (Object) null)) {
|
|
return charSequence.subSequence(prefix.length(), charSequence.length());
|
|
}
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removeRange(@NotNull CharSequence charSequence, int i, int i2) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
if (i2 < i) {
|
|
throw new IndexOutOfBoundsException("End index (" + i2 + ") is less than start index (" + i + ").");
|
|
}
|
|
if (i2 == i) {
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
StringBuilder sb = new StringBuilder(charSequence.length() - (i2 - i));
|
|
sb.append(charSequence, 0, i);
|
|
Intrinsics.checkNotNullExpressionValue(sb, "append(...)");
|
|
sb.append(charSequence, i2, charSequence.length());
|
|
Intrinsics.checkNotNullExpressionValue(sb, "append(...)");
|
|
return sb;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removeSuffix(@NotNull CharSequence charSequence, @NotNull CharSequence suffix) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
|
if (endsWith$default(charSequence, suffix, false, 2, (Object) null)) {
|
|
return charSequence.subSequence(0, charSequence.length() - suffix.length());
|
|
}
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removeSurrounding(@NotNull CharSequence charSequence, @NotNull CharSequence prefix, @NotNull CharSequence suffix) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
|
if (charSequence.length() >= suffix.length() + prefix.length() && startsWith$default(charSequence, prefix, false, 2, (Object) null) && endsWith$default(charSequence, suffix, false, 2, (Object) null)) {
|
|
return charSequence.subSequence(prefix.length(), charSequence.length() - suffix.length());
|
|
}
|
|
return charSequence.subSequence(0, charSequence.length());
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String replace(CharSequence charSequence, Regex regex, String replacement) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
return regex.replace(charSequence, replacement);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceAfter(@NotNull String str, char c2, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
return indexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, indexOf$default + 1, str.length(), (CharSequence) replacement).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String replaceAfter$default(String str, char c2, String str2, String str3, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str3 = str;
|
|
}
|
|
return replaceAfter(str, c2, str2, str3);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceAfterLast(@NotNull String str, @NotNull String delimiter, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
return lastIndexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, delimiter.length() + lastIndexOf$default, str.length(), (CharSequence) replacement).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String replaceAfterLast$default(String str, String str2, String str3, String str4, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str4 = str;
|
|
}
|
|
return replaceAfterLast(str, str2, str3, str4);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceBefore(@NotNull String str, char c2, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
return indexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, 0, indexOf$default, (CharSequence) replacement).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String replaceBefore$default(String str, char c2, String str2, String str3, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str3 = str;
|
|
}
|
|
return replaceBefore(str, c2, str2, str3);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceBeforeLast(@NotNull String str, char c2, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
return lastIndexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, 0, lastIndexOf$default, (CharSequence) replacement).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String replaceBeforeLast$default(String str, char c2, String str2, String str3, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str3 = str;
|
|
}
|
|
return replaceBeforeLast(str, c2, str2, str3);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String replaceFirst(CharSequence charSequence, Regex regex, String replacement) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
return regex.replaceFirst(charSequence, replacement);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.5")
|
|
@InlineOnly
|
|
@JvmName(name = "replaceFirstCharWithChar")
|
|
@OverloadResolutionByLambdaReturnType
|
|
private static final String replaceFirstCharWithChar(String str, Function1<? super Character, Character> transform) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
|
if (str.length() > 0) {
|
|
char charValue = transform.invoke(Character.valueOf(str.charAt(0))).charValue();
|
|
String substring = str.substring(1);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return charValue + substring;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
@SinceKotlin(version = "1.5")
|
|
@InlineOnly
|
|
@JvmName(name = "replaceFirstCharWithCharSequence")
|
|
@OverloadResolutionByLambdaReturnType
|
|
private static final String replaceFirstCharWithCharSequence(String str, Function1<? super Character, ? extends CharSequence> transform) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
|
if (str.length() > 0) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append((Object) transform.invoke(Character.valueOf(str.charAt(0))));
|
|
String substring = str.substring(1);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
sb.append(substring);
|
|
return sb.toString();
|
|
}
|
|
return str;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence replaceRange(@NotNull CharSequence charSequence, int i, int i2, @NotNull CharSequence replacement) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
if (i2 >= i) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(charSequence, 0, i);
|
|
Intrinsics.checkNotNullExpressionValue(sb, "append(...)");
|
|
sb.append(replacement);
|
|
sb.append(charSequence, i2, charSequence.length());
|
|
Intrinsics.checkNotNullExpressionValue(sb, "append(...)");
|
|
return sb;
|
|
}
|
|
throw new IndexOutOfBoundsException("End index (" + i2 + ") is less than start index (" + i + ").");
|
|
}
|
|
|
|
public static final void requireNonNegativeLimit(int i) {
|
|
if (i >= 0) {
|
|
} else {
|
|
throw new IllegalArgumentException(android.support.v4.media.a.e(i, "Limit must be non-negative, but was ").toString());
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public static final List<String> split(@NotNull CharSequence charSequence, @NotNull String[] delimiters, boolean z, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiters, "delimiters");
|
|
if (delimiters.length == 1) {
|
|
String str = delimiters[0];
|
|
if (str.length() != 0) {
|
|
return split$StringsKt__StringsKt(charSequence, str, z, i);
|
|
}
|
|
}
|
|
Iterable asIterable = SequencesKt.asIterable(rangesDelimitedBy$StringsKt__StringsKt$default(charSequence, delimiters, 0, z, i, 2, (Object) null));
|
|
ArrayList arrayList = new ArrayList(CollectionsKt.collectionSizeOrDefault(asIterable, 10));
|
|
Iterator it = asIterable.iterator();
|
|
while (it.hasNext()) {
|
|
arrayList.add(substring(charSequence, (IntRange) it.next()));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
private static final List<String> split$StringsKt__StringsKt(CharSequence charSequence, String str, boolean z, int i) {
|
|
boolean z2;
|
|
requireNonNegativeLimit(i);
|
|
int i2 = 0;
|
|
int indexOf = indexOf(charSequence, str, 0, z);
|
|
if (indexOf != -1 && i != 1) {
|
|
if (i > 0) {
|
|
z2 = true;
|
|
} else {
|
|
z2 = false;
|
|
}
|
|
int i3 = 10;
|
|
if (z2) {
|
|
i3 = RangesKt.coerceAtMost(i, 10);
|
|
}
|
|
ArrayList arrayList = new ArrayList(i3);
|
|
do {
|
|
arrayList.add(charSequence.subSequence(i2, indexOf).toString());
|
|
i2 = str.length() + indexOf;
|
|
if (z2 && arrayList.size() == i - 1) {
|
|
break;
|
|
}
|
|
indexOf = indexOf(charSequence, str, i2, z);
|
|
} while (indexOf != -1);
|
|
arrayList.add(charSequence.subSequence(i2, charSequence.length()).toString());
|
|
return arrayList;
|
|
}
|
|
return CollectionsKt.listOf(charSequence.toString());
|
|
}
|
|
|
|
public static /* synthetic */ List split$default(CharSequence charSequence, String[] strArr, boolean z, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
i = 0;
|
|
}
|
|
return split(charSequence, strArr, z, i);
|
|
}
|
|
|
|
@NotNull
|
|
public static final Sequence<String> splitToSequence(@NotNull CharSequence charSequence, @NotNull String[] delimiters, boolean z, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiters, "delimiters");
|
|
return SequencesKt.map(rangesDelimitedBy$StringsKt__StringsKt$default(charSequence, delimiters, 0, z, i, 2, (Object) null), new e(1, charSequence));
|
|
}
|
|
|
|
public static /* synthetic */ Sequence splitToSequence$default(CharSequence charSequence, String[] strArr, boolean z, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
i = 0;
|
|
}
|
|
return splitToSequence(charSequence, strArr, z, i);
|
|
}
|
|
|
|
public static final String splitToSequence$lambda$0$StringsKt__StringsKt(CharSequence charSequence, IntRange it) {
|
|
Intrinsics.checkNotNullParameter(it, "it");
|
|
return substring(charSequence, it);
|
|
}
|
|
|
|
public static final String splitToSequence$lambda$1$StringsKt__StringsKt(CharSequence charSequence, IntRange it) {
|
|
Intrinsics.checkNotNullParameter(it, "it");
|
|
return substring(charSequence, it);
|
|
}
|
|
|
|
public static final boolean startsWith(@NotNull CharSequence charSequence, char c2, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return charSequence.length() > 0 && CharsKt__CharKt.equals(charSequence.charAt(0), c2, z);
|
|
}
|
|
|
|
public static /* synthetic */ boolean startsWith$default(CharSequence charSequence, char c2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return startsWith(charSequence, c2, z);
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence subSequence(@NotNull CharSequence charSequence, @NotNull IntRange range) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
return charSequence.subSequence(range.getStart().intValue(), range.getEndInclusive().intValue() + 1);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substring(@NotNull String str, @NotNull IntRange range) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
String substring = str.substring(range.getStart().intValue(), range.getEndInclusive().intValue() + 1);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static /* synthetic */ String substring$default(CharSequence charSequence, int i, int i2, int i3, Object obj) {
|
|
if ((i3 & 2) != 0) {
|
|
i2 = charSequence.length();
|
|
}
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return charSequence.subSequence(i, i2).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringAfter(@NotNull String str, char c2, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
if (indexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(indexOf$default + 1, str.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static /* synthetic */ String substringAfter$default(String str, char c2, String str2, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str2 = str;
|
|
}
|
|
return substringAfter(str, c2, str2);
|
|
}
|
|
|
|
@NotNull
|
|
public static String substringAfterLast(@NotNull String str, char c2, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
if (lastIndexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(lastIndexOf$default + 1, str.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static /* synthetic */ String substringAfterLast$default(String str, char c2, String str2, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str2 = str;
|
|
}
|
|
return substringAfterLast(str, c2, str2);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringBefore(@NotNull String str, char c2, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
if (indexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(0, indexOf$default);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static /* synthetic */ String substringBefore$default(String str, char c2, String str2, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str2 = str;
|
|
}
|
|
return substringBefore(str, c2, str2);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringBeforeLast(@NotNull String str, char c2, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
if (lastIndexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(0, lastIndexOf$default);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static /* synthetic */ String substringBeforeLast$default(String str, char c2, String str2, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str2 = str;
|
|
}
|
|
return substringBeforeLast(str, c2, str2);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.5")
|
|
public static final boolean toBooleanStrict(@NotNull String str) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
if (Intrinsics.areEqual(str, "true")) {
|
|
return true;
|
|
}
|
|
if (Intrinsics.areEqual(str, "false")) {
|
|
return false;
|
|
}
|
|
throw new IllegalArgumentException(android.support.v4.media.a.C("The string doesn't represent a boolean value: ", str));
|
|
}
|
|
|
|
@SinceKotlin(version = "1.5")
|
|
@Nullable
|
|
public static final Boolean toBooleanStrictOrNull(@NotNull String str) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
if (Intrinsics.areEqual(str, "true")) {
|
|
return Boolean.TRUE;
|
|
}
|
|
if (Intrinsics.areEqual(str, "false")) {
|
|
return Boolean.FALSE;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trim(@NotNull CharSequence charSequence, @NotNull Function1<? super Character, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
int length = charSequence.length() - 1;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i <= length) {
|
|
boolean booleanValue = ((Boolean) com.mycompany.app.dialog.a.g(charSequence, !z ? i : length, predicate)).booleanValue();
|
|
if (z) {
|
|
if (!booleanValue) {
|
|
break;
|
|
}
|
|
length--;
|
|
} else if (booleanValue) {
|
|
i++;
|
|
} else {
|
|
z = true;
|
|
}
|
|
}
|
|
return charSequence.subSequence(i, length + 1);
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimEnd(@NotNull CharSequence charSequence, @NotNull Function1<? super Character, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
int length = charSequence.length() - 1;
|
|
if (length < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
while (true) {
|
|
int i = length - 1;
|
|
if (!((Boolean) com.mycompany.app.dialog.a.g(charSequence, length, predicate)).booleanValue()) {
|
|
return charSequence.subSequence(0, length + 1);
|
|
}
|
|
if (i < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
length = i;
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimStart(@NotNull CharSequence charSequence, @NotNull Function1<? super Character, Boolean> function1) {
|
|
int b = com.mycompany.app.dialog.a.b(charSequence, "<this>", function1, "predicate");
|
|
for (int i = 0; i < b; i++) {
|
|
if (!((Boolean) com.mycompany.app.dialog.a.g(charSequence, i, function1)).booleanValue()) {
|
|
return charSequence.subSequence(i, charSequence.length());
|
|
}
|
|
}
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
|
|
public static /* synthetic */ boolean contains$default(CharSequence charSequence, char c2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return contains(charSequence, c2, z);
|
|
}
|
|
|
|
public static final boolean endsWith(@NotNull CharSequence charSequence, @NotNull CharSequence suffix, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
|
if (!z && (charSequence instanceof String) && (suffix instanceof String)) {
|
|
return StringsKt__StringsJVMKt.endsWith$default((String) charSequence, (String) suffix, false, 2, null);
|
|
}
|
|
return regionMatchesImpl(charSequence, charSequence.length() - suffix.length(), suffix, 0, suffix.length(), z);
|
|
}
|
|
|
|
public static /* synthetic */ boolean endsWith$default(CharSequence charSequence, CharSequence charSequence2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return endsWith(charSequence, charSequence2, z);
|
|
}
|
|
|
|
public static /* synthetic */ int indexOf$default(CharSequence charSequence, String str, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return indexOf(charSequence, str, i, z);
|
|
}
|
|
|
|
public static /* synthetic */ int indexOfAny$default(CharSequence charSequence, Collection collection, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return indexOfAny(charSequence, (Collection<String>) collection, i, z);
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOf$default(CharSequence charSequence, String str, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = getLastIndex(charSequence);
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return lastIndexOf(charSequence, str, i, z);
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOfAny$default(CharSequence charSequence, Collection collection, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = getLastIndex(charSequence);
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return lastIndexOfAny(charSequence, (Collection<String>) collection, i, z);
|
|
}
|
|
|
|
public static /* synthetic */ String padEnd$default(String str, int i, char c2, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
c2 = ' ';
|
|
}
|
|
return padEnd(str, i, c2);
|
|
}
|
|
|
|
public static /* synthetic */ String padStart$default(String str, int i, char c2, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
c2 = ' ';
|
|
}
|
|
return padStart(str, i, c2);
|
|
}
|
|
|
|
public static /* synthetic */ Sequence rangesDelimitedBy$StringsKt__StringsKt$default(CharSequence charSequence, String[] strArr, int i, boolean z, int i2, int i3, Object obj) {
|
|
if ((i3 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i3 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i3 & 8) != 0) {
|
|
i2 = 0;
|
|
}
|
|
return rangesDelimitedBy$StringsKt__StringsKt(charSequence, strArr, i, z, i2);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String replace(CharSequence charSequence, Regex regex, Function1<? super MatchResult, ? extends CharSequence> transform) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
|
return regex.replace(charSequence, transform);
|
|
}
|
|
|
|
public static /* synthetic */ String replaceAfter$default(String str, String str2, String str3, String str4, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str4 = str;
|
|
}
|
|
return replaceAfter(str, str2, str3, str4);
|
|
}
|
|
|
|
public static /* synthetic */ String replaceAfterLast$default(String str, char c2, String str2, String str3, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str3 = str;
|
|
}
|
|
return replaceAfterLast(str, c2, str2, str3);
|
|
}
|
|
|
|
public static /* synthetic */ String replaceBefore$default(String str, String str2, String str3, String str4, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str4 = str;
|
|
}
|
|
return replaceBefore(str, str2, str3, str4);
|
|
}
|
|
|
|
public static /* synthetic */ String replaceBeforeLast$default(String str, String str2, String str3, String str4, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
str4 = str;
|
|
}
|
|
return replaceBeforeLast(str, str2, str3, str4);
|
|
}
|
|
|
|
public static /* synthetic */ List split$default(CharSequence charSequence, char[] cArr, boolean z, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
i = 0;
|
|
}
|
|
return split(charSequence, cArr, z, i);
|
|
}
|
|
|
|
@NotNull
|
|
public static final Sequence<String> splitToSequence(@NotNull CharSequence charSequence, @NotNull char[] delimiters, boolean z, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiters, "delimiters");
|
|
return SequencesKt.map(rangesDelimitedBy$StringsKt__StringsKt$default(charSequence, delimiters, 0, z, i, 2, (Object) null), new e(0, charSequence));
|
|
}
|
|
|
|
public static /* synthetic */ Sequence splitToSequence$default(CharSequence charSequence, char[] cArr, boolean z, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
z = false;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
i = 0;
|
|
}
|
|
return splitToSequence(charSequence, cArr, z, i);
|
|
}
|
|
|
|
public static final boolean startsWith(@NotNull CharSequence charSequence, @NotNull CharSequence prefix, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
if (!z && (charSequence instanceof String) && (prefix instanceof String)) {
|
|
return StringsKt__StringsJVMKt.startsWith$default((String) charSequence, (String) prefix, false, 2, null);
|
|
}
|
|
return regionMatchesImpl(charSequence, 0, prefix, 0, prefix.length(), z);
|
|
}
|
|
|
|
public static /* synthetic */ boolean startsWith$default(CharSequence charSequence, CharSequence charSequence2, boolean z, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
z = false;
|
|
}
|
|
return startsWith(charSequence, charSequence2, z);
|
|
}
|
|
|
|
@Deprecated(message = "Use parameters named startIndex and endIndex.", replaceWith = @ReplaceWith(expression = "subSequence(startIndex = start, endIndex = end)", imports = {}))
|
|
@InlineOnly
|
|
private static final CharSequence subSequence(String str, int i, int i2) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return str.subSequence(i, i2);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String substring(CharSequence charSequence, int i, int i2) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return charSequence.subSequence(i, i2).toString();
|
|
}
|
|
|
|
public static /* synthetic */ String substringAfter$default(String str, String str2, String str3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str3 = str;
|
|
}
|
|
return substringAfter(str, str2, str3);
|
|
}
|
|
|
|
public static /* synthetic */ String substringAfterLast$default(String str, String str2, String str3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str3 = str;
|
|
}
|
|
return substringAfterLast(str, str2, str3);
|
|
}
|
|
|
|
public static /* synthetic */ String substringBefore$default(String str, String str2, String str3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str3 = str;
|
|
}
|
|
return substringBefore(str, str2, str3);
|
|
}
|
|
|
|
public static /* synthetic */ String substringBeforeLast$default(String str, String str2, String str3, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
str3 = str;
|
|
}
|
|
return substringBeforeLast(str, str2, str3);
|
|
}
|
|
|
|
private static final Sequence<IntRange> rangesDelimitedBy$StringsKt__StringsKt(CharSequence charSequence, String[] strArr, int i, boolean z, int i2) {
|
|
requireNonNegativeLimit(i2);
|
|
return new DelimitedRangesSequence(charSequence, i, i2, new f(ArraysKt.asList(strArr), z, 1));
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceAfter(@NotNull String str, @NotNull String delimiter, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
return indexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, delimiter.length() + indexOf$default, str.length(), (CharSequence) replacement).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceAfterLast(@NotNull String str, char c2, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, c2, 0, false, 6, (Object) null);
|
|
return lastIndexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, lastIndexOf$default + 1, str.length(), (CharSequence) replacement).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceBefore(@NotNull String str, @NotNull String delimiter, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
return indexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, 0, indexOf$default, (CharSequence) replacement).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String replaceBeforeLast(@NotNull String str, @NotNull String delimiter, @NotNull String replacement, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
return lastIndexOf$default == -1 ? missingDelimiterValue : replaceRange((CharSequence) str, 0, lastIndexOf$default, (CharSequence) replacement).toString();
|
|
}
|
|
|
|
public static /* synthetic */ List split$default(CharSequence charSequence, Regex regex, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.split(charSequence, i);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.6")
|
|
@InlineOnly
|
|
private static final Sequence<String> splitToSequence(CharSequence charSequence, Regex regex, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.splitToSequence(charSequence, i);
|
|
}
|
|
|
|
public static /* synthetic */ Sequence splitToSequence$default(CharSequence charSequence, Regex regex, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.splitToSequence(charSequence, i);
|
|
}
|
|
|
|
public static /* synthetic */ boolean startsWith$default(CharSequence charSequence, CharSequence charSequence2, int i, boolean z, int i2, Object obj) {
|
|
if ((i2 & 4) != 0) {
|
|
z = false;
|
|
}
|
|
return startsWith(charSequence, charSequence2, i, z);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substring(@NotNull CharSequence charSequence, @NotNull IntRange range) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
return charSequence.subSequence(range.getStart().intValue(), range.getEndInclusive().intValue() + 1).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringAfter(@NotNull String str, @NotNull String delimiter, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
if (indexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(delimiter.length() + indexOf$default, str.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringAfterLast(@NotNull String str, @NotNull String delimiter, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
if (lastIndexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(delimiter.length() + lastIndexOf$default, str.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringBefore(@NotNull String str, @NotNull String delimiter, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int indexOf$default = indexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
if (indexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(0, indexOf$default);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@NotNull
|
|
public static final String substringBeforeLast(@NotNull String str, @NotNull String delimiter, @NotNull String missingDelimiterValue) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
Intrinsics.checkNotNullParameter(missingDelimiterValue, "missingDelimiterValue");
|
|
int lastIndexOf$default = lastIndexOf$default((CharSequence) str, delimiter, 0, false, 6, (Object) null);
|
|
if (lastIndexOf$default == -1) {
|
|
return missingDelimiterValue;
|
|
}
|
|
String substring = str.substring(0, lastIndexOf$default);
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
public static final boolean contains(@NotNull CharSequence charSequence, char c2, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
return indexOf$default(charSequence, c2, 0, z, 2, (Object) null) >= 0;
|
|
}
|
|
|
|
public static final int indexOf(@NotNull CharSequence charSequence, @NotNull String string, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(string, "string");
|
|
if (!z && (charSequence instanceof String)) {
|
|
return ((String) charSequence).indexOf(string, i);
|
|
}
|
|
return indexOf$StringsKt__StringsKt$default(charSequence, string, i, charSequence.length(), z, false, 16, null);
|
|
}
|
|
|
|
public static final int lastIndexOf(@NotNull CharSequence charSequence, @NotNull String string, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(string, "string");
|
|
if (!z && (charSequence instanceof String)) {
|
|
return ((String) charSequence).lastIndexOf(string, i);
|
|
}
|
|
return indexOf$StringsKt__StringsKt(charSequence, string, i, 0, z, true);
|
|
}
|
|
|
|
@NotNull
|
|
public static String removePrefix(@NotNull String str, @NotNull CharSequence prefix) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
if (!startsWith$default((CharSequence) str, prefix, false, 2, (Object) null)) {
|
|
return str;
|
|
}
|
|
String substring = str.substring(prefix.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@NotNull
|
|
public static String removeSuffix(@NotNull String str, @NotNull CharSequence suffix) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
|
if (!endsWith$default((CharSequence) str, suffix, false, 2, (Object) null)) {
|
|
return str;
|
|
}
|
|
String substring = str.substring(0, str.length() - suffix.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@NotNull
|
|
public static final String removeSurrounding(@NotNull String str, @NotNull CharSequence prefix, @NotNull CharSequence suffix) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
|
if (str.length() < suffix.length() + prefix.length() || !startsWith$default((CharSequence) str, prefix, false, 2, (Object) null) || !endsWith$default((CharSequence) str, suffix, false, 2, (Object) null)) {
|
|
return str;
|
|
}
|
|
String substring = str.substring(prefix.length(), str.length() - suffix.length());
|
|
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
|
|
return substring;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final boolean contains(CharSequence charSequence, Regex regex) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.containsMatchIn(charSequence);
|
|
}
|
|
|
|
public static final boolean startsWith(@NotNull CharSequence charSequence, @NotNull CharSequence prefix, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
if (!z && (charSequence instanceof String) && (prefix instanceof String)) {
|
|
return StringsKt__StringsJVMKt.startsWith$default((String) charSequence, (String) prefix, i, false, 4, null);
|
|
}
|
|
return regionMatchesImpl(charSequence, i, prefix, 0, prefix.length(), z);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String removeRange(String str, int i, int i2) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return removeRange((CharSequence) str, i, i2).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removeSurrounding(@NotNull CharSequence charSequence, @NotNull CharSequence delimiter) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
return removeSurrounding(charSequence, delimiter, delimiter);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String replaceRange(String str, int i, int i2, CharSequence replacement) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
return replaceRange((CharSequence) str, i, i2, replacement).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence removeRange(@NotNull CharSequence charSequence, @NotNull IntRange range) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
return removeRange(charSequence, range.getStart().intValue(), com.mycompany.app.dialog.a.d(range, 1));
|
|
}
|
|
|
|
@NotNull
|
|
public static String removeSurrounding(@NotNull String str, @NotNull CharSequence delimiter) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiter, "delimiter");
|
|
return removeSurrounding(str, delimiter, delimiter);
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence replaceRange(@NotNull CharSequence charSequence, @NotNull IntRange range, @NotNull CharSequence replacement) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
return replaceRange(charSequence, range.getStart().intValue(), com.mycompany.app.dialog.a.d(range, 1), replacement);
|
|
}
|
|
|
|
public static final int indexOfAny(@NotNull CharSequence charSequence, @NotNull Collection<String> strings, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(strings, "strings");
|
|
Pair<Integer, String> findAnyOf$StringsKt__StringsKt = findAnyOf$StringsKt__StringsKt(charSequence, strings, i, z, false);
|
|
if (findAnyOf$StringsKt__StringsKt != null) {
|
|
return findAnyOf$StringsKt__StringsKt.getFirst().intValue();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public static final int lastIndexOfAny(@NotNull CharSequence charSequence, @NotNull Collection<String> strings, int i, boolean z) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(strings, "strings");
|
|
Pair<Integer, String> findAnyOf$StringsKt__StringsKt = findAnyOf$StringsKt__StringsKt(charSequence, strings, i, z, true);
|
|
if (findAnyOf$StringsKt__StringsKt != null) {
|
|
return findAnyOf$StringsKt__StringsKt.getFirst().intValue();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String trim(String str) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return trim((CharSequence) str).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trim(@NotNull String str, @NotNull Function1<? super Character, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
int length = str.length() - 1;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i <= length) {
|
|
boolean booleanValue = predicate.invoke(Character.valueOf(str.charAt(!z ? i : length))).booleanValue();
|
|
if (z) {
|
|
if (!booleanValue) {
|
|
break;
|
|
}
|
|
length--;
|
|
} else if (booleanValue) {
|
|
i++;
|
|
} else {
|
|
z = true;
|
|
}
|
|
}
|
|
return str.subSequence(i, length + 1).toString();
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String trimEnd(String str) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return trimEnd((CharSequence) str).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trimEnd(@NotNull String str, @NotNull Function1<? super Character, Boolean> predicate) {
|
|
CharSequence charSequence;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
int length = str.length() - 1;
|
|
if (length >= 0) {
|
|
while (true) {
|
|
int i = length - 1;
|
|
if (!predicate.invoke(Character.valueOf(str.charAt(length))).booleanValue()) {
|
|
charSequence = str.subSequence(0, length + 1);
|
|
break;
|
|
}
|
|
if (i < 0) {
|
|
break;
|
|
}
|
|
length = i;
|
|
}
|
|
return charSequence.toString();
|
|
}
|
|
charSequence = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
return charSequence.toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final List<String> split(@NotNull CharSequence charSequence, @NotNull char[] delimiters, boolean z, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(delimiters, "delimiters");
|
|
if (delimiters.length == 1) {
|
|
return split$StringsKt__StringsKt(charSequence, String.valueOf(delimiters[0]), z, i);
|
|
}
|
|
Iterable asIterable = SequencesKt.asIterable(rangesDelimitedBy$StringsKt__StringsKt$default(charSequence, delimiters, 0, z, i, 2, (Object) null));
|
|
ArrayList arrayList = new ArrayList(CollectionsKt.collectionSizeOrDefault(asIterable, 10));
|
|
Iterator it = asIterable.iterator();
|
|
while (it.hasNext()) {
|
|
arrayList.add(substring(charSequence, (IntRange) it.next()));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String removeRange(String str, IntRange range) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
return removeRange((CharSequence) str, range).toString();
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String replaceRange(String str, IntRange range, CharSequence replacement) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(range, "range");
|
|
Intrinsics.checkNotNullParameter(replacement, "replacement");
|
|
return replaceRange((CharSequence) str, range, replacement).toString();
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final String trimStart(String str) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return trimStart((CharSequence) str).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trim(@NotNull CharSequence charSequence, @NotNull char... chars) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = charSequence.length() - 1;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i <= length) {
|
|
boolean contains = ArraysKt.contains(chars, charSequence.charAt(!z ? i : length));
|
|
if (z) {
|
|
if (!contains) {
|
|
break;
|
|
}
|
|
length--;
|
|
} else if (contains) {
|
|
i++;
|
|
} else {
|
|
z = true;
|
|
}
|
|
}
|
|
return charSequence.subSequence(i, length + 1);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trimStart(@NotNull String str, @NotNull Function1<? super Character, Boolean> predicate) {
|
|
CharSequence charSequence;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
int length = str.length();
|
|
int i = 0;
|
|
while (true) {
|
|
if (i < length) {
|
|
if (!predicate.invoke(Character.valueOf(str.charAt(i))).booleanValue()) {
|
|
charSequence = str.subSequence(i, str.length());
|
|
break;
|
|
}
|
|
i++;
|
|
} else {
|
|
charSequence = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
break;
|
|
}
|
|
}
|
|
return charSequence.toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final String padEnd(@NotNull String str, int i, char c2) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return padEnd((CharSequence) str, i, c2).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static String padStart(@NotNull String str, int i, char c2) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
return padStart((CharSequence) str, i, c2).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimEnd(@NotNull CharSequence charSequence, @NotNull char... chars) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = charSequence.length() - 1;
|
|
if (length < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
while (true) {
|
|
int i = length - 1;
|
|
if (!ArraysKt.contains(chars, charSequence.charAt(length))) {
|
|
return charSequence.subSequence(0, length + 1);
|
|
}
|
|
if (i < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
length = i;
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trim(@NotNull String str, @NotNull char... chars) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = str.length() - 1;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i <= length) {
|
|
boolean contains = ArraysKt.contains(chars, str.charAt(!z ? i : length));
|
|
if (z) {
|
|
if (!contains) {
|
|
break;
|
|
}
|
|
length--;
|
|
} else if (contains) {
|
|
i++;
|
|
} else {
|
|
z = true;
|
|
}
|
|
}
|
|
return str.subSequence(i, length + 1).toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimStart(@NotNull CharSequence charSequence, @NotNull char... chars) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = charSequence.length();
|
|
for (int i = 0; i < length; i++) {
|
|
if (!ArraysKt.contains(chars, charSequence.charAt(i))) {
|
|
return charSequence.subSequence(i, charSequence.length());
|
|
}
|
|
}
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final List<String> split(CharSequence charSequence, Regex regex, int i) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(regex, "regex");
|
|
return regex.split(charSequence, i);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trimEnd(@NotNull String str, @NotNull char... chars) {
|
|
CharSequence charSequence;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = str.length() - 1;
|
|
if (length >= 0) {
|
|
while (true) {
|
|
int i = length - 1;
|
|
if (!ArraysKt.contains(chars, str.charAt(length))) {
|
|
charSequence = str.subSequence(0, length + 1);
|
|
break;
|
|
}
|
|
if (i < 0) {
|
|
break;
|
|
}
|
|
length = i;
|
|
}
|
|
return charSequence.toString();
|
|
}
|
|
charSequence = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
return charSequence.toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static CharSequence trim(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
int length = charSequence.length() - 1;
|
|
int i = 0;
|
|
boolean z = false;
|
|
while (i <= length) {
|
|
boolean isWhitespace = CharsKt__CharJVMKt.isWhitespace(charSequence.charAt(!z ? i : length));
|
|
if (z) {
|
|
if (!isWhitespace) {
|
|
break;
|
|
}
|
|
length--;
|
|
} else if (isWhitespace) {
|
|
i++;
|
|
} else {
|
|
z = true;
|
|
}
|
|
}
|
|
return charSequence.subSequence(i, length + 1);
|
|
}
|
|
|
|
@NotNull
|
|
public static final String trimStart(@NotNull String str, @NotNull char... chars) {
|
|
CharSequence charSequence;
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(chars, "chars");
|
|
int length = str.length();
|
|
int i = 0;
|
|
while (true) {
|
|
if (i < length) {
|
|
if (!ArraysKt.contains(chars, str.charAt(i))) {
|
|
charSequence = str.subSequence(i, str.length());
|
|
break;
|
|
}
|
|
i++;
|
|
} else {
|
|
charSequence = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
break;
|
|
}
|
|
}
|
|
return charSequence.toString();
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimEnd(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
int length = charSequence.length() - 1;
|
|
if (length < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
while (true) {
|
|
int i = length - 1;
|
|
if (!CharsKt__CharJVMKt.isWhitespace(charSequence.charAt(length))) {
|
|
return charSequence.subSequence(0, length + 1);
|
|
}
|
|
if (i < 0) {
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
length = i;
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public static final CharSequence trimStart(@NotNull CharSequence charSequence) {
|
|
Intrinsics.checkNotNullParameter(charSequence, "<this>");
|
|
int length = charSequence.length();
|
|
for (int i = 0; i < length; i++) {
|
|
if (!CharsKt__CharJVMKt.isWhitespace(charSequence.charAt(i))) {
|
|
return charSequence.subSequence(i, charSequence.length());
|
|
}
|
|
}
|
|
return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
|
|
}
|
|
}
|