jchanghong.kotlin.Strings.kt Maven / Gradle / Ivy
package jchanghong.kotlin
import cn.hutool.core.util.StrUtil
fun main() {
println("".isNotNUllOrBlank())
println("Asasa".removePreAndLowerFirst(null))
}
fun String?.isNotNUllOrBlank() = !this.isNullOrBlank()
fun String?.toCamelCase(): String {
this?:return ""
return StrUtil.toCamelCase(this)
}
fun String?.toUnderlineCase(): String {
this?:return ""
return StrUtil.toUnderlineCase(this)
}
fun String?.removePreAndLowerFirst(prefix:String?): String {
this?:return ""
return StrUtil.removePreAndLowerFirst(this,prefix?:"")
}