title: How remove white spaces in Go
body: <p>I want remove spaces in String value, for example: "I d skd a efju N" to "IdskdaefjuN" and it's not working...</p>
  
  <p>I tried using:</p>
  
  <pre><code>stringValue = strings.Replace(stringValue, " ", "", -1)
  </code></pre>
  
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      "fmt"
      "strings"
  )
  
  func main() {
      //var String
      var stringValue string
      var originalValue string
      fmt.Printf("please, type some text:")
      //user input
      fmt.Scan(&amp;stringValue)
      originalValue = stringValue
      //remove spaces
      stringValue = strings.Replace(stringValue, " ", "", -1)
      //set string to lower case
      stringValue = strings.ToLower(stringValue)
      //if contains substring "i", "a" and "n"
      if strings.Contains(stringValue, "i") &amp;&amp; strings.Contains(stringValue, "a") &amp;&amp; strings.Contains(stringValue, "n") {
          // if "i" is a prefix and "n" a suffix
          firstChar := strings.HasPrefix(stringValue, "i")
          lastChar := strings.HasSuffix(stringValue, "n")
          switch {
          //if is a prefix and suffix so Found
          case firstChar &amp;&amp; lastChar:
              fmt.Printf("Found in %s", originalValue)
          //if isnt a prefix and suffix so Not Found
          default:
              fmt.Printf("Not Found in %s", originalValue)
          }
          //if there's no "i", "a" and "n"
      } else {
          fmt.Printf("Not Found in %s", originalValue)
      }
  }
  </code></pre>