Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

How should I split a string with no spaces in vim script? All the options which I see are to split a string with spaces. I even tried split(string_name) without a delimiter , but it doesn't work.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You need to use \zs as delimiter to split string into individual characters:

:echo split("Hello", '\zs')
['H', 'e', 'l', 'l', 'o']
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.