Example usage for org.apache.commons.lang3 StringUtils substring

List of usage examples for org.apache.commons.lang3 StringUtils substring

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils substring.

Prototype

public static String substring(final String str, int start, int end) 

Source Link

Document

Gets a substring from the specified String avoiding exceptions.

A negative start position can be used to start/end n characters from the end of the String.

The returned substring starts with the character in the start position and ends before the end position.

Usage

From source file:tw.edu.chit.struts.action.registration.ReportPrintAction.java

private String printNativeDate(String date) {
    return String.valueOf(Integer.parseInt(StringUtils.substring(date, 0, 4)) - Global.NativeYearBase)
            + StringUtils.substring(date, 4).replaceAll("0", "");
}