android-components / mozilla.components.support.ktx.kotlin / kotlin.String

Extensions for kotlin.String

| Name | Summary | |—|—| | isEmail | fun String.isEmail(): Boolean | | isGeoLocation | fun String.isGeoLocation(): Boolean | | isPhone | fun String.isPhone(): Boolean | | isUrl | fun String.isUrl(): Boolean
Checks if this String is a URL. | | isUrlStrict | fun String.isUrlStrict(): Boolean
Checks if this string is a URL. | | sha1 | fun String.sha1(): String
Calculates a SHA1 hash for this string. | | toDate | fun String.toDate(format: String, locale: Locale = Locale.ROOT): Date
Converts a String to a Date object.fun String.toDate(vararg possibleFormats: String = arrayOf( "yyyy-MM-dd'T'HH:mm", "yyyy-MM-dd", "yyyy-'W'ww", "yyyy-MM", "HH:mm" )): Date?
Tries to convert a String to a Date using a list of possibleFormats. | | toNormalizedUrl | fun String.toNormalizedUrl(): String | | tryGetHostFromUrl | fun String.tryGetHostFromUrl(): String
Tries to parse and get host part if this String is valid URL. Otherwise returns the string. |