I have the following code that based on the input (args) I want to create a string but the answer is incorrect. I have args(0) is a path, args(1) is an operand like "+", and args(2) is a number (and I want to put space between them:
//some code .. var Statement="" for (j<-0 to 2) { if (Files.exists(Paths.get(args(j)))){ Statement.concat(inputXml) Statement.concat(" ") } else{ Statement.concat(args(j)) Statement.concat(" ") } println(args(j)) println(Statement) } println(Statement) //some code ... the output is a blank! I have used this link as reference. Would you please help me on this I am new in Scala. Thanks.
a.concat(b)should be written asa+b