Check If a String Contains a Substring 1. Overview In this tutorial, we’ll review several ways of checking if a String contains a substring, and we’ll compare the performance of each. 2. String.indexOf Let’s first try using the String.indexOf method. indexOf gives us the first position where the substring is… Continue Reading java-string-contains-substring

Common String Operations in Java 1. Introduction String-based values and operations are quite common in everyday development, and any Java developer must be able to handle them. In this tutorial, we’ll provide a quick cheat sheet of common String operations. Additionally, we’ll shed some light on the differences between equals and “==”… Continue Reading java-string-operations

Templating with Handlebars 1. Overview In this tutorial, we’ll look into the Handlebars.java library for easy template management. 2. Maven Dependencies Let’s start with adding the handlebars dependency: <dependency> <groupId>com.github.jknack</groupId> <artifactId>handlebars</artifactId> <version>4.1.2</version> </dependency> 3. A Simple Template A Handlebars template can be any kind of text file. It consists of… Continue Reading handlebars

An Introduction to Apache Commons Lang 3 1. Overview The Apache Commons Lang 3 library is a popular, full-featured package of utility classes, aimed at extending the functionality of the Java API. The library’s repertoire is pretty rich, ranging from string, array and number manipulation, reflection and concurrency, to the implementations… Continue Reading java-commons-lang-3