Rabbit-R1/original r1/java/sources/kotlin/text/_OneToManyTitlecaseMappingsKt.java
2024-05-21 17:08:36 -04:00

31 lines
1.5 KiB
Java

package kotlin.text;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: _OneToManyTitlecaseMappings.kt */
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010\u000e\n\u0002\u0010\f\n\u0000\u001a\f\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0000¨\u0006\u0003"}, d2 = {"titlecaseImpl", "", "", "kotlin-stdlib"}, k = 2, mv = {1, 9, 0}, xi = 48)
/* loaded from: classes3.dex */
public final class _OneToManyTitlecaseMappingsKt {
public static final String titlecaseImpl(char c) {
String valueOf = String.valueOf(c);
Intrinsics.checkNotNull(valueOf, "null cannot be cast to non-null type java.lang.String");
String upperCase = valueOf.toUpperCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
if (upperCase.length() <= 1) {
return String.valueOf(Character.toTitleCase(c));
}
if (c == 329) {
return upperCase;
}
char charAt = upperCase.charAt(0);
Intrinsics.checkNotNull(upperCase, "null cannot be cast to non-null type java.lang.String");
String substring = upperCase.substring(1);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
Intrinsics.checkNotNull(substring, "null cannot be cast to non-null type java.lang.String");
String lowerCase = substring.toLowerCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(lowerCase, "toLowerCase(...)");
return charAt + lowerCase;
}
}