All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.sephiroth.android.library.asm.commons.utils.StringUtils.kt Maven / Gradle / Ivy

Go to download

Android gradle plugin which inject at compile time method logging (initially forked from Hunter-Debug)

The newest version!
package it.sephiroth.android.library.asm.commons.utils

object StringUtils {
    fun replaceLastPart(originString: String, replacement: String, toReplace: String): String {
        val start = originString.lastIndexOf(replacement)
        val builder = StringBuilder()
        builder.append(originString, 0, start)
        builder.append(toReplace)
        builder.append(originString.substring(start + replacement.length))
        return builder.toString()
    }

    fun getSimpleClassName(fullClassName: String): String {
        return fullClassName.split("[\\/\\.]".toRegex()).last()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy