When I use Code A, I get the original string ,why?
Code B can replace string both ${myObject.status} and ${myObject.name}, the result is OK.
Image
Code A
<string name="DetailsOfWiFiDef">The WiFi status is ${myObject.status},
the name of WiFi is ${myObject.name}\n\n
</string>
val myObject=getIt()
val s=mContext.getString(R.string.DetailsOfWiFiDef)
val sb = StringBuilder()
sb.append(s) //The string keep original
Code B
val myObject=getIt()
val k="The WiFi status is ${myObject.status},the name of WiFi is ${myObject.name} \n"
val sb = StringBuilder()
sb.append(k) //It has been replaced
