sanitizeAsJavaIdentifier function moved to JvmAbi
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.load.java;
|
||||
|
||||
import kotlin.StringsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.name.ClassId;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
@@ -90,5 +91,10 @@ public final class JvmAbi {
|
||||
char c = name.charAt(IS_PREFIX.length());
|
||||
return !('a' <= c && c <= 'z');
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String sanitizeAsJavaIdentifier(@NotNull String str) {
|
||||
return StringsKt.replace(str, StringsKt.toRegex("[^\\p{L}\\p{Digit}]"), "_");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user