title: Common Lisp: The Remove Function, how is it used?
body: <p>I have a query request-uri in the form of "/node/143" (just an example of the format).</p>
  
  <p>I want to strip the first forward slash from the string, I looked up the function <a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node144.html" rel="noreferrer">remove</a> and had a try. I just can't seem to get it working (I'm using SBCL on Linux).</p>
  
  <p>I've set the request-uri using this code.</p>
  
  <pre><code>(setq request-uri "/node/143")
  </code></pre>
  
  <p>When I check the variable I have this returned.</p>
  
  <pre><code>request-uri
  "/node/143"
  </code></pre>
  
  <p>I now try to remove the first slash (at this point it's just anything at all to see how the function is properly used).</p>
  
  <pre><code>(remove "/" request-uri)
  "/node/143"
  
  (remove '/ request-uri)
  "/node/143"
  </code></pre>
  
  <p>I even tried supplying a list</p>
  
  <pre><code>(remove '("/") request-uri)
  "/node/143"
  
  (remove '('/) request-uri)
  "/node/143"
  </code></pre>
  
  <p>Even though strings are <a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node164.html#SECTION002200000000000000000" rel="noreferrer">vectors of characters</a> I thought that somehow maybe the whole string may be placed in one cell and I tried to remove the whole thing, still no luck.</p>
  
  <pre><code>(remove "/node/143" request-uri)
  "/node/143"
  
  (remove '/node143 request-uri)
  "/node/143"
  </code></pre>
  
  <p>So I'm at a loss right now, this seemingly simple function has really eluded me, I thought I followed the documentation to the letter, but nothing is working.</p>
  
  <p>Can anyone shed some light on what's happening here?</p>
  
  <p>Thanks.</p>
  
  <p><strong><em>Edit: I found the answer to my question, which raised another question.</em></strong></p>
  
  <p>To remove an element from the string I used</p>
  
  <pre><code>(remove #\/ request-uri)
  </code></pre>
  
  <p>What about a whole string</p>
  
  <pre><code>`(remove #\node request-uri`)
  </code></pre>
  
  <p>Only works for the first character and throws an error, and the following all do nothing.</p>
  
  <pre><code>(remove "node" request-uri)
  (remove 'node request-uri)
  (remove ?\node request-uri)
  (remove #\node request-uri)
  (remove '("node") request-uri)
  </code></pre>
  
  <p>I'm not sure how else it should be addressed here.</p>