Apache Commons Lang

Apache Commons Lang is a widely-used Java library that provides various utility functions for working with basic Java objects, including strings, arrays, numbers, and more.

Maven Dependency

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.12.0</version>
</dependency>

Categories

Splitting of various utility methods across different categories.

  • StringUtils Class

import org.apache.commons.lang3.StringUtils;

Methods

abbreviate(String str, int maxWidth)

It is used to abbreviate or shorten a string to a specified length while appending an ellipsis ("...") to indicate that the string has been shortened.

  • ArrayUtils Class

import org.apache.commons.lang3.ArrayUtils
  • NumberUtils Class

  • SystemUtils Class

  • RandomStringUtils Class

  • DateUtils Class

  • EqualsBuilder

  • HashCodeBuilder Class

Last updated