fun String?.compareTo(other: String?): Int
Compares two nullable String objects. |
|
fun String.htmlAsSpannable(tagHandler: TagHandler? = null): CharSequence?
Converts HTML text to a formatted string as performed by Html.fromHtml. Suppresses any exceptions. |
|
fun String.htmlEncode(): String
HTML-encodes a string by calling TextUtils.htmlEncode. |
|
fun String.toColorInt(): Int
Uses Color.parseColor to convert string representation of a color (such as "#cedefa") to integer representation. |
|
fun String.toColorIntOrNull(): Int?
Uses Color.parseColor to convert string representation of a color to integer, or null if string can't be parsed. |
|
fun String.toURL(context: URL? = null): URL
|
|
fun String.toURLOrNull(context: URL? = null): URL?
Converts a String to URL, with an optional URL context returning null if string cannot be parsed. |
|
fun String.toUri(): Uri
|
|
fun String.toUriOrNull(): Uri?
Converts a String to Uri by calling Uri.parse; returning null if the string cannot be parsed. |
|
fun String.urlDecode(encoding: String = "UTF-8"): String
Decodes a URL-encoded string by calling URLDecoder.decode. |
|
fun String.urlEncode(encoding: String = "UTF-8"): String
URL-encodes a string by calling URLEncoder.encode. |