Scala BitSet addString() method with example Last Updated : 04 May, 2020 Comments Improve Suggest changes Like Article Like Report Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The addString() method is utilised to append all elements of this traversable or iterator to a string builder. Method Definition: def addString() Return Type: It returns the string builder b to which elements were appended. Example #1: Scala // Scala program of Bitset addString // method import scala.collection.immutable.BitSet // Creating object object GfG { // Main method def main(args:Array[String]) { val bitSet: BitSet = BitSet(0, 1, 2, 3) val b = new StringBuilder() // Applying BitSet addString() function val bs1 = bitSet.addString(b) // Displays output println(bs1) } } Output: 0123 Example #2: Scala // Scala program of Bitset addString // method import scala.collection.immutable.BitSet // Creating object object GfG { // Main method def main(args:Array[String]) { val bitSet: BitSet = BitSet(11, 22, 33) val b = new StringBuilder() // Applying BitSet addString() function val bs1 = bitSet.addString(b) // Displays output println(bs1) } } Output: 112233 Comment More infoAdvertise with us Next Article Scala BitSet addString() method with example S Shivam_k Follow Improve Article Tags : Python Scala scala Immutable-collection Scala Immutable-BitSet Practice Tags : python Similar Reads Scala Map addString() method with example The addString() method is utilized to add the elements of the map to the String Builder. Method Definition: def addString(b: StringBuilder): StringBuilder Return Type: It returns the elements in the String Builder. Example #1: Scala // Scala program of addString() // method // Creating object object 1 min read Scala BitSet +() method with example Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The +() method is utilised create a new set with an additional element, unless the element is already present. Method Definition: def +() Return Type: It returns a new set 2 min read Scala BitSet ++() method with example Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The +() method is utilised create a new set by adding all elements contained in another collection to this set, omitting duplicates. Method Definition: def ++() Return Type 1 min read Scala List addString() method with example The addString() method is utilized to append all the elements of the list to a string builder. Method Definition: def addString(b: StringBuilder): StringBuilder Return Type: It returns the elements of the list to a string builder. Example #1: Scala // Scala program of addString() // method // Creati 1 min read Scala BitSet apply() method with example Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The +() method is utilised to test if some element is contained in this set. Method Definition: def apply() Return Type: true if elem is contained in this set, false otherw 1 min read Scala Iterator addString() method with example The addString() method belongs to the concrete value members of the class AbstractIterator. It is defined in the class IterableOnceOps. It is utilized to append the elements of the Scala Iterator to a String Builder. Method Definition : def addString(b: StringBuilder): StringBuilder Return Type : It 1 min read Scala SortedMap addString() method with example The addString() method is utilized to add the elements of the SortedMap to the String Builder. Method Definition: def addString(b: StringBuilder): StringBuilder Return Type: It returns the elements in the String Builder. Example #1: Scala // Scala program of addString() // method import scala.collec 1 min read Scala BitSet +(elems: Int*) method with example Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The +(elems: Int*) method is utilised create a new set with additional elements, omitting duplicates. Method Definition: def +() Return Type: It returns a new set omitting 1 min read Scala BitSet -(elems: Int*) method with example Scala Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The -(elems: Int*) method is utilised takes two or more elements to be removed. Method Definition: def +() Return Type: a new collection that contains all elements except o 1 min read Scala Mutable SortedMap addString() method with example The addString() method is utilized to add the elements of the SortedMap to the String Builder. Method Definition: def addString(b: StringBuilder): StringBuilder Return Type: It returns the elements in the String Builder. Example #1: Scala // Scala program of addString() // method import scala.collec 1 min read Like