String.format does not support no locale #KT-22932
This commit is contained in:
@@ -15,6 +15,7 @@ import java.nio.charset.Charset
|
||||
import java.nio.charset.CodingErrorAction
|
||||
import java.util.Locale
|
||||
import java.util.regex.Pattern
|
||||
import kotlin.internal.LowPriorityInOverloadResolution
|
||||
|
||||
|
||||
/**
|
||||
@@ -288,17 +289,38 @@ public inline fun String.Companion.format(format: String, vararg args: Any?): St
|
||||
* Uses this string as a format string and returns a string obtained by substituting the specified arguments,
|
||||
* using the specified locale.
|
||||
*/
|
||||
@LowPriorityInOverloadResolution
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.format(locale: Locale, vararg args: Any?): String = java.lang.String.format(locale, this, *args)
|
||||
|
||||
/**
|
||||
* Uses this string as a format string and returns a string obtained by substituting the specified arguments,
|
||||
* using the specified locale. If [locale] is `null` then no localization is applied.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@JvmName("formatNullable")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.format(locale: Locale?, vararg args: Any?): String = java.lang.String.format(locale, this, *args)
|
||||
|
||||
/**
|
||||
* Uses the provided [format] as a format string and returns a string obtained by substituting the specified arguments,
|
||||
* using the specified locale.
|
||||
*/
|
||||
@LowPriorityInOverloadResolution
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.Companion.format(locale: Locale, format: String, vararg args: Any?): String =
|
||||
java.lang.String.format(locale, format, *args)
|
||||
|
||||
/**
|
||||
* Uses the provided [format] as a format string and returns a string obtained by substituting the specified arguments,
|
||||
* using the specified locale. If [locale] is `null` then no localization is applied.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@JvmName("formatNullable")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.Companion.format(locale: Locale?, format: String, vararg args: Any?): String =
|
||||
java.lang.String.format(locale, format, *args)
|
||||
|
||||
/**
|
||||
* Splits this char sequence around matches of the given regular expression.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user