Insert variables into Text / String
Hello,
is it possible to insert variables into a string without rewriting the complete string ? For example i have a text like:
"Increase your damage with pistols by 15%". I want it to look like: "Increase your damage with pistols by VAR%", while this VAR% gets replaced with some float value for example. How can i do this ? ( I know that i could try it with a splitted string and the float value itself, but that would lead me to rewrite the string. While this sentence will be written 5 times with different values.
"Increase your damage with pistols by " + damageFloat + "%". Because not everytime the value will stay at the end. Thank you
Answer by zh4r0naX · May 31, 2019 at 05:05 PM
Got the answer myself.... i will be doing some $VARS for every modifier. The result is this:
description = description.Replace("$dmg", damageModifier.ToString());