it.sephiroth.android.library.asm.commons.utils.StringUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of asm-commons Show documentation
Show all versions of asm-commons Show documentation
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()
}
}