package com.laseroptek.raman.utils.ext

import android.content.res.Resources
import androidx.annotation.StringRes
import androidx.core.text.parseAsHtml
import androidx.core.text.toHtml
import androidx.core.text.toSpanned

/* get string resource with paramter
   eg. resources.getText(R.string.my_text, "I WILL BE BOLDED")
 */
fun Resources.getText(@StringRes id: Int, vararg formatArgs: Any?): CharSequence =
    getText(id).toSpanned().toHtml().format(*formatArgs).parseAsHtml()