Is there a way in Vim to do the following:
let S = '[''123'', ''456'', ''789'']' let L = parseStringToList(S) " L is a list containing the string '123', '456', and '789'
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You can do this with eval:
let S = '[''123'', ''456'', ''789'']' let L = eval(S)
eval is something you should be wary of. Don't run it on untrusted data. But this does solve your problem.
It's possible there's a completely different approach you should be using, but without context, it's hard to say.