Package-level declarations

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a new File Object with the Current String as Its path

Link copied to clipboard

The Char array representing by this string

Link copied to clipboard
Link copied to clipboard

Decode the String from binary

Link copied to clipboard

Decode String to URL

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Encode String to URL

Link copied to clipboard

Gets extension from filePath

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get md5 string.

Link copied to clipboard
Link copied to clipboard
const val NEW_LINE: String
Link copied to clipboard
Link copied to clipboard

Get sha1 string.

Functions

Link copied to clipboard
fun String.abbreviateMiddle(middle: String, length: Int): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a new File Object with the Current String as Its path

Link copied to clipboard
infix fun Date.asString(parseFormat: String): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Convenience method to clear all content from a StringBuilder.

Link copied to clipboard

Clear all HTML tags from a string.

Link copied to clipboard
Link copied to clipboard
fun String.containsAny(vararg strings: String): Boolean
Link copied to clipboard
Link copied to clipboard

Returns true if this string contains exactly the provided string. This method uses RegEx to evaluate and its case-sensitive. What makes it different from the classic contains is that it doesn't uses indexOf, hence it's more performant when used on long char sequences and has much higher probabilities of not returning false positives per approximation.

Link copied to clipboard
fun String?.containsInArray(vararg names: String, ignoreCase: Boolean = true): Boolean
Link copied to clipboard
fun String.convertDateFormat(fromFormat: String, toFormat: String): String
Link copied to clipboard
Link copied to clipboard

Converts string to camel case. Handles multiple strings and empty strings

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

Decode String to URL

Link copied to clipboard

Decrypt String to AES with the specific Key

Link copied to clipboard
Link copied to clipboard

encode The String to Binary

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

Encode String to URL

Link copied to clipboard

Encrypt String to AES with the specific Key

Link copied to clipboard
Link copied to clipboard
fun Context.getAppApk(pName: String = packageName): File

get Application Apk File

Link copied to clipboard
fun Context.getAppSize(pName: String = packageName): Long

get Application Size in Bytes

Link copied to clipboard
fun Context.getDataColumn(uri: Uri, selection: String?, selectionArg: Array<String>?): String
Link copied to clipboard
Link copied to clipboard
fun getHMac(data: String, key: String): String?

Computes RFC 2104-compliant HMAC signature. This can be used to sign the Amazon S3 request urls

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun String.getRequestUrl(vararg fields: Pair<String, Any>): String
Link copied to clipboard
fun File.getUri(): Uri
Link copied to clipboard
fun String.highlight(source: String, color: Int): SpannableString

Highlight a given word in a string with a given colour

Link copied to clipboard

Highlight substring query in this spannable with custom style. All occurrences of this substring are stylized

Link copied to clipboard
Link copied to clipboard
fun String.ifBlank(mapper: () -> String): String
Link copied to clipboard
fun String.ifEmpty(mapper: () -> String): String
Link copied to clipboard
inline fun String.ifIsNotNullOrEmpty(action: () -> Unit)
Link copied to clipboard
inline fun String.ifIsNullOrEmpty(action: () -> Unit)
Link copied to clipboard
fun String?.ifNull(mapper: () -> String): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Normalize string - convert to lowercase, replace diacritics

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun String.occurrences(pattern: String): Int
Link copied to clipboard
fun SpannableString.onClick(source: String, shouldUnderline: Boolean = true, shouldBold: Boolean = true, color: Int? = null, textView: TextView? = null, onClick: () -> Unit): SpannableString

Take some text, highlight some text with a color and add a click listener to it

Link copied to clipboard
Link copied to clipboard
fun String?.openInBrowser(context: Context?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun randomBytes(length: Int): ByteArray

Generates and returns a random array of bytes of an arbitrary length, or an empty ByteArray if the length parameter is equal to zero.

Link copied to clipboard
fun randomString(length: Int): String

Generate and return a random alpha-numeric String of an arbitrary length, or an empty String if the length parameter is equal to zero.

Link copied to clipboard
Link copied to clipboard
fun String.remove(pattern: String): String
fun String.remove(regex: Regex): String

fun String.remove(value: String, ignoreCase: Boolean = false): String

Removes all occurrences of the value in the string

Link copied to clipboard

Removes decimal number format symbol

Link copied to clipboard

Removes decimal number format symbol

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun String.removeSymbols(replacement: String = "�"): String
Link copied to clipboard
fun String?.replaceDigit(replacement: String = ""): String?
Link copied to clipboard
fun String?.replaceNonDigit(replacement: String = ""): String?
Link copied to clipboard
inline fun <T> T?.safe(default: T): T
Link copied to clipboard
fun String.safeBoolean(default: Boolean = false): Boolean
Link copied to clipboard
fun String.safeByte(default: Byte = 0): Byte
Link copied to clipboard
fun String.safeDouble(default: Double = 0.0): Double
Link copied to clipboard
fun String.safeFloat(default: Float = 0.0f): Float
Link copied to clipboard
fun String.safeInt(default: Int = 0): Int
Link copied to clipboard
fun String.safeLong(default: Long = 0): Long
Link copied to clipboard
fun String.safeShort(default: Short = 0): Short
Link copied to clipboard

Save String to a Given File

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun stringPairOf(vararg pair: Pair<String, Any?>): String
Link copied to clipboard
fun stringSubstring(text: String, start: Int, endInclusive: Int = text.length - 1): String

Computes the substring starting at start and ending at endInclusive, which is the length of text unless specified otherwise.

Link copied to clipboard

Converts a string to boolean such as 'Y', 'yes', 'TRUE'

Link copied to clipboard
Link copied to clipboard
fun String.toDate(format: DateFormat): Date?
infix fun String.toDate(currentFormat: String): Date
Link copied to clipboard
inline fun <T : Enum<T>> String.toEnum(by: (enum: T) -> String = { it.name }): T?

Convert any string value into it's enum value by a given property of the enum

Link copied to clipboard

Converts string to integer safely otherwise returns zero

Link copied to clipboard
@RequiresApi(value = 26)
fun String.toPath(): Path
Link copied to clipboard
Link copied to clipboard

Convenience method for creating a URL from a valid String.

Link copied to clipboard
fun String.trimTo(length: Int): String
Link copied to clipboard
Link copied to clipboard
fun String?.urlDecode(charsetName: String = "UTF-8"): String
Link copied to clipboard
Link copied to clipboard
fun String?.urlEncode(charsetName: String = "UTF-8"): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
infix fun String?.useIfEmpty(otherString: String?): String
Link copied to clipboard
Link copied to clipboard