Added Scala codes for parsing string