Thursday, February 6, 2020

Re: join() a list with a newline char for an echo

Hi,

I agree that works - but my list is from a ch_read() and has ^@ (NL) at the end of each element
and I just cannot seem to get this work.  The join("\n") just puts the ^@ back everywhere.

thx tho,
-m

On Thursday, February 6, 2020 at 6:35:57 PM UTC-5, John Little wrote:
On Friday, February 7, 2020 at 7:53:02 AM UTC+13, M Kelly wrote:

> I have tried join( mylist, "\n") but it uses ^@ and "\r" uses ^M

works fine for me, vim, gvim, and vim --clean.

:let l = ["one", "two", "three"]
:echo join(l, "\n")
one
two
three
Press ENTER or type command to continue

Maybe you're on MS Windows?  Used single quotes?  Have some settings causing trouble? (try with vim --clean).

HTH, John Little

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b5908d0a-4191-4347-a55c-b95266e78945%40googlegroups.com.

No comments: