Wednesday, December 23, 2009

Re: Concatenate each item of two list

Hi,

Christian Brabandt wrote:
>
> On Mi, 23 Dez 2009, epanda wrote:
>
>> I would like to concatenate each item of two list together and
>> resulting another list.
>>
>> let list1 = ["one", "two"]
>> let list2 = ["1", "2"]
>>
>> concat(list1,list2)
>>
>> resultingList = ["one1", "two2"]
>
>
> If you have a recent enough vim, something like this should work:
> call map(list1, 'v:val.list2[v:idx]')

it's v:key, not v:idx.

> You need to have at least patchlevel 295 of version 7.2, otherwise this
> won't work. I have only 7.2.284, so I can't test.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment