Scala programming language is employed in working with data logs and their manipulation. Data logs are entered into the code as a single string which might contain multiple lines of code and to work properly with this type of strings we need to convert multiline string to an array of single-line string in Scala.
Program:
Output
Explanation:
To convert the given multiline string to an array. Here, we have used two methods: split and filter.
need an explanation for this answer? contact us directly to get an explanation for this answer