Dinesh Panchananam
Dinesh Panchananam

Reputation: 694

One line Scala equivalent of this Python Snippet

I'm looking for a one line Scala equivalent of this Python snippet

a, b, c, d = map(int, raw_input().split(" ")) 

Can some body help?

Upvotes: 1

Views: 123

Answers (1)

Sergii Lagutin
Sergii Lagutin

Reputation: 10671

val Array(a, b, c, d) = str.split(" ").map(_.toInt)

Upvotes: 6

Related Questions