Monday, May 7, 2012

Re: Expanding a range of characters

more shorter.

echo call('range', split('46-58', '-'))

On Tuesday, May 8, 2012 4:06:55 AM UTC+9, Tim Chase wrote:
> On 05/07/12 14:03, Christian Brabandt wrote:
> > But this should work:
> > let r = split('46-58', '-')
> > echo range(r[0], r[1])
>
> This might even be an elegant place for multi-assignment:
>
> let [b:start, b:end] = split('46-58', '-')
> echo range(b:start, b:end)
>
> (this is one of the things I love about Python)
>
> -tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: