Scala Reverse String

[Solved] Scala Reverse String | Scala - Code Explorer | yomemimo.com
Question : scala string reverse

Answered by : aleksandr-freik

scala> val x = "scala is awesome"
x: java.lang.String = scala is awesome
scala> x.reverse
res1: String = emosewa si alacs

Source : https://stackoverflow.com/questions/7700399/scala-reverse-string | Last Update : Wed, 21 Sep 22

Question : scala reverse string

Answered by : sohan

def reverse(s: String) : String =
(for(i <- s.length - 1 to 0 by -1) yield s(i)).mkString

Source : https://stackoverflow.com/questions/7700399/scala-reverse-string | Last Update : Fri, 06 Nov 20

Answers related to scala reverse string

Code Explorer Popular Question For Scala