aboutsummaryrefslogtreecommitdiffstats
path: root/str.vim
blob: 74a05aa0558b268e503867d9a5267231575433fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 14, 2011
" URL: http://peterodding.com/code/vim/misc/

" Trim whitespace from start and end of string.

function! xolox#misc#str#trim(s)
  return substitute(a:s, '^\_s*\(.\{-}\)\_s*$', '\1', '')
endfunction

" vim: ts=2 sw=2 et