title: In Vim a script/plugin, how do I visual selection string then replace with a new string?
body: <p>I want to try writing a few simple VIM plugins. What I have in mind to would involve taking the current visual selection, processing that string then replacing the selection with the result. Later I'd like to try extend this to work with text objects and ranges.</p>
  
  <p>Specifically I'd like to know how to:</p>
  
  <ul>
  <li>Get a string from the current character-wise selection</li>
  <li>Delete the selection</li>
  <li>Insert my new string</li>
  </ul>