This method is same as addString() method but here we can even include a separator between all the elements of an Iterator.
Method Definition : def addString(b: StringBuilder, sep: String): StringBuilder
Where, sep is the separator.
Return Type :It returns the elements of an iterator in the String Builder along with the separator stated.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.