Categories
Scala

Run a Json REST API with Scala Http4s in 5 minutes

In this quick tutorial, we will show you how to run a Json REST API with Scala in 5 minutes and only 10 lines of code, thanks to the awesome Http4s library. 0) Prerequisites You need java and sbt installed on your machine. In this tutorial, I am using Java 11 and Sbt 1.5.5. 1) […]

Categories
Scala

Extract text between two strings with Scala regex

Scala as a very light syntax compared to Java. To extract the text between two strings tag1 and tag2 from the string content, we can use the Scala regex syntax. We only need 2 lines of code: You can print extracted in a main: When you execute the code above, you will get the following […]