Scala Converting multiline string to BigInt
I'm trying to parse 100 50-digit numbers from string with below piece of code: val input = """37107287533902102798797998220837590246510135740250 |46376937677490009712648124896970078050417018260538 |74324986199524741059474233309513058123726617309629""".stripMargin val list = input.split("""\n""").map(BigInt(_)) but I'm ending with "java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)". I don't have any idea why this does not work, since when string is splited, each element of list is of type String. Any help would be much appreciated. Best regards Probably you're on