title: Char or String -> Unicode value in Scala?
body: <p>So I'm working through a few of the exercises in "Scala for the Impatient" and one of them is:</p>
  
  <p>Write a <code>for</code> loop for computing the product of the Unicode codes of all letters in a string. For example, the product of the characters in "Hello" is 9415087488 L.</p>
  
  <p>The next problem is to do the same, but without a <code>for</code> loop - it hints that we should check <code>StringOps</code> in Scaladoc.</p>
  
  <p>I checked the <code>RichChar</code> and <code>StringOps</code> section in Scaladoc, and perhaps I'm misreading or looking in the wrong places, but I can't find anything that gets me to match their output. I've thus far tried:</p>
  
  <pre><code>scala&gt; x.foldLeft(1)(_ * _.toInt)
  res0: Int = 825152896
  
  scala&gt; x.foldLeft(1)(_ * _.getNumericValue)
  res5: Int = 2518992
  
  scala&gt; x.foldLeft(1)(_ * _.intValue())
  res6: Int = 825152896
  
  scala&gt; var x = 1
  x: Int = 1
  
  scala&gt; for (c &lt;- "Hello") x *= c.toInt
  
  scala&gt; x
  res12: Int = 825152896
  </code></pre>
  
  <p>Which does not match their output.</p>
  
  <p>How do I do this, in both the <code>for</code> and non-<code>for</code> way?</p>
  
  <p>Thanks!</p>