'toString' and 'mkString'

Viewing 1 reply thread
  • Author
    • #6589

      ‘mkString’ is used in place of ‘toString’ in ‘ScoreAnalysis’ program. Any particular reason to use mkString or is it just to demonstrate various functions that are used for the same purpose?

    • #6590

      We read a text file into an iterator.. Hence, if you perform toString(), it won’t return the contents of the file. It returns the string representation of the iterator object.
      Then, mkString() will read the iterator & loop over the values and create the String based on the values.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.