1

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?

1 Answer 1

6
val Array(a, b, c, d) = str.split(" ").map(_.toInt)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply, but its not working. Tested on Scala 2.11 REPL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.