Learn how to repeat a character or several characters multiple times in Scala.
Also find me here:
Baeldung Author
Pedro Rijo
Software Engineer with 8y experience in fascinating startups and scale-ups. Backend developer who worked with many different programming languages, but amazed with Scala for many years. Open Source Maintainer. Some days I work as a full stack developer. I play with many different technologies.
Here's what I've written (so far):
Baeldung on Scala
- All
- Scala Collections (23)
- Scala Strings (7)
- Scala Numbers (4)
- Scala IO (4)
- Scala Dates (2)
- Scala Basics (2)
- Build Tools (2)
- Scala Syntax (1)
- Scala Exceptions (1)
- Scala Core (1)
Check if All Elements in a List Are Equal in Scala
Filed under Scala Collections
Learn to check if all elements of a list are equal.
Convert a List of String to List of Int in Scala
Filed under Scala Collections
A quick and practical guide to converting a List of Strings to a List of Ints in Scala.
Reversing Strings in Scala
Filed under Scala Strings
Learn how to reverse strings in Scala.
Get the Week of the Year From a Date in Scala
Filed under Scala Dates
Learn how to get the week of the year from a date in Scala.
Remove Duplicate Characters From a String in Scala
Filed under Scala Strings
Learn how to remove duplicate characters from a String in Scala.
Reverse the Sign of an Int in Scala
Filed under Scala Numbers
Learn how to reverse the sign of an Int in Scala.
Handling Multiple Exceptions Together in Scala
Filed under Scala Exceptions
Learn how to handle multiple exceptions together in Scala.
Get the Index of Element With Max Value in a Scala List
Filed under Scala Collections
Learn how to get the index of a list’s maximum in Scala.
Insert a Character at an Index in a Scala String
Filed under Scala Strings
Learn how to insert a character at an index in a Scala string.
Convert a Number to Binary Representation in Scala
Filed under Scala Numbers
Learn how to convert a number to its binary representation in Scala.
Iterate a List Backwards in Scala
Filed under Scala Collections
Learn how to iterate a Scala list backward using only the existing Scala standard syntax constructors.
Convert Epoch Milliseconds to DateTime in Scala
Filed under Scala Dates
Learn how to convert epoch milliseconds to DateTime in Scala.
PriorityQueue in Scala
Filed under Scala Collections
A quick and practical guide to PriorityQueue in Scala.
Calculate Elapsed Time of a Method in Scala
Filed under Scala Basics
Learn various ways to calculate the elapsed time of a method in Scala.
Compare Floating Point Numbers in Scala
Filed under Scala Numbers
Learn how to compare floating point numbers in Scala
Find the Most Frequent Element in a Scala Collection
Filed under Scala Collections
Learn how to find the most frequent element in lists and other Scala collections.
Finding the Difference Between Two Lists in Scala
Filed under Scala Collections
Learn how to find the difference between two lists in Scala.
Generate Frequency Map of Strings in Scala
Filed under Scala Collections
Learn how to generate a frequency map of strings in Scala.
Get the Current Scala Version
Filed under Scala Core
Learn how to find the current Scala version.
Creating a New Scala Sbt Project Using Giter8
Filed under Build Tools
Learn how to create a new scala SBT project using Giter8.
Querying Mappings in Scala Maps
Filed under Scala Collections
Learn how to query Maps for the existence of the query keys.
Using foreach() Method in Scala Collections
Filed under Scala Collections
Learn how to use foreach() Method in Scala Collections
Find Min and Max of a Collection in Scala
Filed under Scala Collections
Learn how to find the min and max of different collections in Scala.
Remove All Whitespace From a String in Scala
Filed under Scala Strings
Learn to remove all whitespace from a string in Scala.
Remove an Item by Index From a List
Filed under Scala Collections
Learn how to remove an item by index from a list in Scala.
Count the Number of Occurrences of an Element in a List
Filed under Scala Collections
Learn how to count the number of occurrences of an element in a list in Scala.
Replace Elements in a Scala List by Index
Filed under Scala Collections
Learn how to replace elements in a Scala List by index.
Shuffle Collections in Scala
Filed under Scala Collections
Learn how to shuffle Scala collections.
Create a List With the Same Repeated Element
Filed under Scala Collections
Learn how to make a list in Scala by repeating the same element.
Get a Random Element From an Array in Scala
Filed under Scala Collections
Learn how to draw a random element from a Scala array.
Find the Element With Max Value in a Map in Scala
Filed under Scala Collections
Learn how to find the maximal element in a Scala Map.
Generate a List of Random Numbers in Scala
Filed under Scala Collections
Learn how to generate a list of random numbers.
List Files in a Directory in Scala
Filed under Scala IO
Learn how to list files in a local filesystem.
Remove Elements from the End of a String in Scala
Filed under Scala Strings
Learn how we to remove characters from the end of a String in Scala.
Get a Random Number in Scala
Filed under Scala Numbers
Learn how to generate a random number in Scala.
Find Unique Items in a List in Scala
Filed under Scala Collections
Learn how to find unique items in a list using Scala
Console I/O in Scala
Filed under Scala IO
Learn how to read user input using Scala.
Guide to ArrayBuffer
Filed under Scala Collections
In this tutorial, we’ll dig into the Scala ArrayBuffer class.
Read a File From the Resources Folder in Scala
Filed under Scala IO
In this tutorial, we’ll learn different approaches to reading a file from the resources folder in Scala
Printing Arrays in Scala
Filed under Scala Collections
In this tutorial, we’ll learn different approaches to printing the contents of an Array in Scala.
Check if a String Is a Number in Scala
Filed under Scala Strings
In this tutorial, we’ll see a few different solutions to check if a given string is a number using Scala.
Check If a File or Path Exists in Scala
Filed under Scala IO
Learn a few different solutions to find if a given file or directory exists using Scala.
Guide to Annotations in Scala
Filed under Scala Basics
Learn about annotations in Scala.
Optional Braces in Scala 3
Filed under Scala Syntax
Learn about optional braces in Scala 3.
Parameter Untupling in Scala 3
Filed under Scala Collections
In this tutorial, we’ll look into the new parameter untupling capabilities introduced in Scala 3.
How to See the Dependency Tree in SBT?
Filed under Build Tools
In this tutorial, we’ll see why and how to use SBT to check our project dependency tree.