Skip to content

Repository files navigation

Strings

The idea of this library is to fulfill only one gap - missing JDK String manipulations and checks. Yes, I could use commons-lang3, but I got tired of neverending CVEs mainly caused by unrelated to String manipulations. So this library starts small, mainly with operations which I used in the last 15 years of enterprise development (very few)

Warning

Under active development 🚧

Features

  • Null-safe operations – All methods handle null inputs gracefully without throwing exceptions.
  • Empty checks – Check whether a character sequence is empty or not.
  • Blank checks – Determine if a string contains only whitespace characters.
  • Capitalization – Convert the first character of a string to uppercase while preserving the rest.

Requirements

Java 25

Usage

Add to your project

<dependencies>
<dependency>
<groupId>com.petromirdzhunev.libs</groupId>
<artifactId>strings</artifactId>
</dependency>
</dependencies>

Code

importcom.petromirdzhunev.strings.Strings;
publicclassExample {
publicstaticvoidmain(String[] args) {
// Empty checksStrings.isEmpty(null); // trueStrings.isEmpty(""); // trueStrings.isEmpty("hello"); // falseStrings.isNotEmpty("hello"); // true// Blank checksStrings.isBlank(null); // trueStrings.isBlank(""); // trueStrings.isBlank(" "); // trueStrings.isBlank("hello"); // false// CapitalizationStrings.capitalize("hello"); // "Hello"Strings.capitalize("Hello"); // "Hello"Strings.capitalize(null); // nullStrings.capitalize("éhello"); // Éhello
}
}

Development

Prerequisites

  1. Install SDKMAN
  2. Initialize SDKMAN environment
sdk env install

Check .sdkmanrc for all the tools installed with this command.

Build and publish SNAPSHOT versions to local repository

Change the version by adding a -SNAPSHOT suffix in the pom.xml file and then execute:

 mvnd -B clean install

Pointing to a SNAPSHOT version

<dependencies>
<dependency>
<groupId>com.petromirdzhunev.lib</groupId>
<artifactId>strings</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>

Support my work

Buy Me A Ko-fiBuy Me A CoffeeGitHub Sponsor

About

Zero dependency String manipulation library

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages