Scala reverse string

def reverse(str: String) : String =
(for(i <- str.length - 1 to 0 by -1) yield s(i)).mkString
Content Protection by DMCA.com
Please Share