Package-level declarations

Types

Link copied to clipboard

Convert numbers from english to other languages.

Properties

Link copied to clipboard
@get:JvmName(name = "containsDigit")
val String.containsDigit: Boolean

Return a Boolean if the string contains digit.

Link copied to clipboard
@get:JvmName(name = "containsLatinLetter")
val String.containsLatinLetter: Boolean

Return a Boolean if the string contains latin letter.

Link copied to clipboard
@get:JvmName(name = "containsPersianDigit")
val String.containsPersianDigit: Boolean

Return a Boolean if the string contains persian digit.

Link copied to clipboard
@get:JvmName(name = "hasLettersAndDigits")
val String.hasLettersAndDigits: Boolean

Return a Boolean if the string contains both letter and digit.

Link copied to clipboard
val String.isAlphanumeric: Boolean

Return a Boolean if the string is alphanumeric.

Link copied to clipboard
val String.isDecimalNumber: Boolean

Return a Boolean if the string is decimal number.

Link copied to clipboard
val String.isDigit: Boolean

Return a Boolean if the string is digit.

Link copied to clipboard
val String.isHttp: Boolean

If the string is an HTTP URL (ie Starts with http:// or https://)

Link copied to clipboard
val String.isIntegerNumber: Boolean

Return a Boolean if the string is integer number.

Link copied to clipboard
val String.isPersianDigit: Boolean

Return a Boolean if the string is a persian digit.

Link copied to clipboard
@get:JvmName(name = "lastPathComponent")
val String.lastPathComponent: String

Get last path segment of the string.

Link copied to clipboard
val String.urlDecode: String

Decodes an application/x-www-form-urlencoded string using a specific encoding scheme.

Link copied to clipboard
val String.urlEncode: String

Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.

Functions

Link copied to clipboard
fun StringBuilder.appendSpace(): StringBuilder

append space in string builders

Link copied to clipboard
fun String.capitalize(): String

Returns a copy of this string having it's first letter title cased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

Link copied to clipboard
fun Number.compactFormat(): String

Compact format numbers.

Link copied to clipboard
@JvmOverloads
fun String.decodeToUrl(charset: String = "UTF-8"): String

Decodes an application/x-www-form-urlencoded string using a specific encoding scheme.

Link copied to clipboard
@JvmOverloads
fun String.encodeToUrl(charset: String = "UTF-8"): String

Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.

Link copied to clipboard
@JvmOverloads
fun Number.format(pattern: String = "#,###.##"): String

Format numbers with given pattern.

Link copied to clipboard
@JvmOverloads
fun String.formatCreditCard(separator: String = " ", separatorDigit: Int = 4): String

Format string as credit card number.

Link copied to clipboard
operator fun String.get(indices: IntProgression): String

Returns the substring from the given progression.

operator fun String.get(indices: IntRange): String

Returns the substring from the given range.

Link copied to clipboard
inline fun String.getOrElse(indices: IntProgression, defaultValue: () -> String): String

Returns the substring from the given progression if exist otherwise return else block.

inline fun String.getOrElse(indices: IntRange, defaultValue: () -> String): String

Returns the substring from the given range if exist otherwise return else block.

Link copied to clipboard
fun String.getOrNull(indices: IntProgression): String?

Returns the substring from the given progression if exist otherwise return a null.

fun String.getOrNull(indices: IntRange): String?

Returns the substring from the given range if exist otherwise return a null.

Link copied to clipboard
inline fun String.hasValidLength(length: Int, block: () -> Unit)

Checks that the length of a string is valid for block execution

Link copied to clipboard
fun String?.isNotNull(): Boolean

Checking nullability.

Link copied to clipboard
fun String?.isNotNullNotBlank(): Boolean

Return true if string not null and not blank.

Link copied to clipboard
fun String?.isNotNullNotEmpty(): Boolean

Return true if string not null and not empty.

Link copied to clipboard
fun String?.isNotNullOrBlank(): Boolean

Return true if string not null and not blank.

Link copied to clipboard
fun String?.isNotNullOrEmpty(): Boolean

Return true if string not null and not empty.

Link copied to clipboard
fun String?.isNull(): Boolean

Checking nullability.

Link copied to clipboard
@JvmOverloads
fun <T> joinWith(vararg params: T, separator: CharSequence = " ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (T) -> CharSequence? = null): String

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
fun Double.removeDecimalPart(): String

Remove decimal part when Double number has decimal part.

fun Float.removeDecimalPart(): String

Remove decimal part when Float number has decimal part.

Link copied to clipboard
@JvmOverloads
fun String.rotateLeft(n: Int = 1): String

Rotates the String to the left by specified distance.

Link copied to clipboard
@JvmOverloads
fun String.rotateRight(n: Int = 1): String

Rotates the String to the right by specified distance.