Scala list takeRight() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List takeRight() operation with examples. Scala takeRight() operation allows us to take the last N elements in the collection. takeRight() operation will return new collection with last/rear N elements.i.e., elements from right to left. Scala takeRight() operation is applicable to all types of Scala collections. takeRight() Syntax […]

Scala list take() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List take() operation with examples. Scala take() operation allows us to take first N elements in the collection. take() operation will return new collection with first N elements. Scala take() operation is applicable to all types of Scala collections. take() Syntax def take(n: Int): List[A] Selects the […]

Scala List sameElements() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List sameElements() operation with examples. Scala sameElements() operation is a useful operation of the Scala List or any collection which allows us to compare and check if both collections are having the same elements in the same order. When you apply sameElements() method on a collection with […]

Scala List reverse() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List reverse() operation with examples. Scala reverse() operation which allows reversing the elements of the list.reverse() operation will return a new collection by reversing the elements of the collection. reverse() operation is applicable to all types of Scala collections and it is really a useful function to […]

Scala List findLast() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List findLast() operation with examples. Scala findLast() operation is a useful operation of the Scala List or any collection which allows us to get/find the last element from the list or collection based on a given predicate function. When you call this findLast() operation on a Scala […]

Scala List find() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List find() operation with examples. Scala find() operation is a useful operation of the Scala List or any collection which allows us to get/find the first element from the list or collection based on a given predicate function. When you call this operation on a Scala list, […]

Scala List filterNot() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List filterNot() operation with examples. Scala filterNot() operation is a useful operation of the Scala List or any collection which allows us to filter elements from the list or collection which is not satisfying given predicate function. When you call this filterNot() operation on a Scala list, […]

Scala List filter() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List filter() operation with examples. Scala filter() operation is a useful operation of the Scala List or any collection which allows us to filter elements from the list or collection based on a given predicate function. When you call this operation on a Scala list, it returns […]

Scala List drop() operation with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List drop() operation with examples. drop() operation is a useful operation of the Scala List which allows us to drop first N elements from the list or collection. When you call this operation on a Scala list, it returns a new collection by dropping the first […]

Scala List addString() with examples

Welcome to the Scala series. In this tutorial, you will learn about the Scala List addString() operation with examples. There is an alternative to addString() operation in Scala, please have a look at mkString() List() is a collection to store values in an ordered fashion. addString() is the most useful method of a Scala collection which allows generating a string […]

Scala List mkString() with examples

Welcome to Scala series. In this tutorial, you will learn about the Scala List mkString() operation with examples. There is an alternative to mkString() operation in Scala, please have a look at addString() List() is a collection to store values in an ordered fashion. mkString() is the most useful method of a Scala collection which allows generating a string based on the […]

Scala List count() operation with examples

Welcome to Scala series. In this tutorial, you will learn about the Scala List count() operation with examples. List() is a collection to store values in an ordered fashion. count() operation is a useful operation of the Scala List which allows us to count the number of elements of the list based on a given predicate function. When you call this […]

Scala List sum() operation with examples

Welcome to Scala series. In this tutorial, you will learn about Scala List sum() operation with examples. List() is a collection to store values in an ordered fashion. sum() operation is a useful operation of the Scala List which allows us to retrieve the sum of elements of the list. When you call this operation on a Scala list, it returns […]