title: Scala: iterate through every character of a String and use pattern matching
body: <p>I think what I'm trying to do is pretty obvious. For every character in a string1, print something using patter matching. (I have string2 there because I will use pattern matching of string1 to do something to string 2 and return String 2)</p>
  
  <p>For some reason my code only prints out "()". </p>
  
  <p>Also how do I make sure that my code returns a String. When I put the code in terminal it says: (string1: String)String => Unit , how do I make it say (string1: String)String => String</p>
  
  <pre><code>def stringPipeline(string1: String) = (string2: String) =&gt; {
  
    for(c &lt;- string1) {
      c match {
        case 'u' =&gt; "Upper Case"
        case 'r' =&gt; "reverse"
        case _ =&gt; "do something"
      }
    }
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I would just like to point out what I wanted to do with string2:</p>
  
  <pre><code>def stringPipeline(string1: String) = (string2: String) =&gt; { 
      for(c &lt;- string1) yield { 
          c match { 
              case 'U' =&gt; string2.toUpperCase 
              case 'r' =&gt; string2.reverse } } } 
  </code></pre>
  
  <p>But it's return a vector/list of strings. I want all those cases to work on the same string2 object. So if I test the method on "hello", it should return "OLLEH".</p>
  
  <p>Thanks</p>