title: Middle Character swift
body: <p>I have an issue I am trying to solve </p>
  
  <p>I am trying to find middle character of the word. If the word's length is odd, return the middle character. If the word's length is even, return the middle 2 characters</p>
  
  <pre><code>func middle(_ str: String) -&gt; String {
      let arr = Array(str).map{$0}
  
      print(arr)
  //    if arr.count
      for myInt: String in arr {
          if myInt % 2 == 0 {
              println("\(myInt) is even number")
          } else {
              println("\(myInt) is odd number")
          }
      }
      return ""
  }
  </code></pre>