My idea is to have elements of a list modified by appending to each of them a string. How could this be achieved? I haven't find any function that allow me to do that.
Have you tried formatlist()?
For example:
my_list_var = ["a", "b", "c"]
my_new_list = formatlist("%s-foo", var.mylist)
my_new_list will be:
["a-foo", "b-foo", "c-foo"]
Yo can also pass another list of the same length as parameter to append different strings to each element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With