title: Haskell replace space with Char
body: <p>I'm trying to come up with a function that will replace all the blank spaces in a string with <code>"%50"</code> or similar and I know I'm messing up something with my types but can't seem to figure it out I have been trying the following (yes I have imported <code>Data.Char</code>)</p>
  
  <pre><code>newLine :: String -&gt; String
  newLine xs = if x `elem` " " then "%50"
  </code></pre>
  
  <p>I also tried the if then else statement but really didn't know what to do with the else so figured just lowercase all the letters with</p>
  
  <pre><code>newLine xs = [if x `elem` ' ' then '%50' else toLower x | x&lt;-xs]
  </code></pre>
  
  <p>would like the else statement to simply do nothing but have searched and found no way of doing that so i figured if everything was lowercase it wouldn't really matter just trying to get this to work.</p>