Thursday, November 4, 2010

manipulation of multi-byte strings

Hello,

I'm in the process on upgrading my scripts to support multi-byte strings.
I've identified a few needs for now:
- a mbyte strlen
- a get-at(pos) operator

Regarding string length, |strlen()| recommends to play with substitute(), however I see strwidth() that seems to do the work, is there a reason that this is not the recommended way ?

Regarding [] alternative, matchstr('.\{'.pos.'}\zs.\ze') does the job (for pos > 0). Is there a better way to proceed ?

--
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

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