I have a string template that will be read in from a file, so I can’t do regular $-interpolation on it. For example, the template might be “20+%1+5”, and I will want to substitute a value at run-time for “%1". Should I just use
String.replace()
or
String.format()
, or is there a more elegant solution in Kotlin than there would be in Java?
p
pniederw
02/11/2020, 7:33 PM
I'm not aware of a kotlin specific solution
🙏 1
➕ 1
e
Ellen Spertus
02/11/2020, 7:34 PM
@pniederw Thanks! That’s a lot better than not getting an answer.
t
tddmonkey
02/11/2020, 7:43 PM
Do the simplest thing that can work until you need something more complex