RichUtils / pyxis.uzuki.live.richutilskt.utils / kotlin.String

Extensions for kotlin.String

createJSONArray

fun String.createJSONArray(): JSONArray?

create JSONArray from String

createJSONObject

fun String.createJSONObject(): JSONObject?

create JSONObject from String

getBitmap

fun String.getBitmap(): Bitmap?

get bitmap from filePath

getFileExtension

fun String.getFileExtension(): String

get extensions of given file path

getImageHeight

fun String.getImageHeight(): Int

get Height of Image which given String

getImageMimeType

fun String.getImageMimeType(): String

get MimeType of Image which given String

getImageWidth

fun String.getImageWidth(): Int

get Width of Image which given String

getVideoHeight

fun String.getVideoHeight(): Int

get Height of Video which given String

getVideoWidth

fun String.getVideoWidth(): Int

get Width of Video which given String

isEmpty

fun String.isEmpty(): Boolean

return string empty state

isEmptyOrReturn

fun String.isEmptyOrReturn(default: String = ""): String

get string with empty handling

isExistReadFile

fun String.isExistReadFile(): Boolean

Test given path is exists and can read

parseDate

fun String.parseDate(format: String? = "yyyy-MM-dd HH:mm:ss"): Date?

parsing date from String

toDateString

fun String.toDateString(fromFormat: String, toFormat: String): String

format formatted date to another formatted date

toFile

fun String.toFile(): File

make String to File