Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: arkoreI have a need to concatenate a list of strings with single characters. I've figured out how to do it but it seems quite ugly. I would welcome any advice on a method I'm missing.
I have a list of strings named "inputs"
To concatenate a single character "<" to the start of every string in the list I first need to create a list of this character with a dynamic length as so:
lth = "".pad(len(inputs),"<").replace("<","<,").left(2*l en(inputs)-1)
Then I can use map to join the two lists of strings elementwise:
joined = map(&strcat,lth,inputs)
Is there a better way of achieving the same result?