Added tests.
This commit is contained in:
parent
7333ffc1b4
commit
f8df79e7ff
2 changed files with 55 additions and 1 deletions
|
@ -18,10 +18,11 @@
|
|||
package net.thauvin.erik.android.tesremoteprogrammer.util
|
||||
|
||||
import android.text.Html
|
||||
import android.text.Spanned
|
||||
|
||||
private val digitPattern = Regex("[0-9]+")
|
||||
|
||||
fun String.fromHtml() = Html.fromHtml(this, Html.FROM_HTML_MODE_LEGACY)
|
||||
fun String.fromHtml(): Spanned = Html.fromHtml(this, Html.FROM_HTML_MODE_LEGACY)
|
||||
|
||||
fun String.isDigits() = isNotBlank() && matches(digitPattern)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue