I am trying to reverse a string, so that
'abc defg hij' becomes
'jih gfed cba'. The solution I came up with is
join(reverse(split(l:text, '.\zs')), '')
Is there a more elegant solution or should I stick with what I have come up with?
Your solution is very elegant! An alternative if you are in Unix based env:
vnoremap <Leader>r c<C-O>:set revins<CR><C-R>"<Esc>:set norevins<CR>
For more see: