> Small problem. How can I quickly strip of a leading space from a
> string?
> 
> let foo = " C"  [leading space]
> Then what is a quick way to get a new variable "bar" in the script
> such that:
> 
> bar="C"        [no leading space]

There are several ways...the shortest for your particular case may be

   let foo=matchstr(' C', '\w\+')

However, you can do it more generically with

   let foo=substitute(' C', '^\s\+', '', '')

-tim


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to