Friday, April 29, 2011

RE: is there s 'toinitialupper' function?

Tim Chase wrote:
> let s=substitute(s, '\w\+', '\u\1', 'g')

The above is intended to change each word in s, making the first
letter uppercase and not changing the rest.

The search pattern needs brackets, or the \1 should be replaced.
The following works:

let s=substitute(s, '\w\+', '\u&', 'g')

John

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

Post a Comment