Example usage for java.lang String substring

List of usage examples for java.lang String substring

Introduction

In this page you can find the example usage for java.lang String substring.

Prototype

public String substring(int beginIndex, int endIndex) 

Source Link

Document

Returns a string that is a substring of this string.

Usage

From source file:Main.java

public static String formatName(String name) {
    return name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();
}

From source file:Main.java

public static String getFileNameFromURL(String url) {
    return url.substring(url.lastIndexOf("/") + 1, url.length());
}

From source file:Main.java

public static String getUrlPath(String url) {
    return url.substring(0, url.lastIndexOf("/") + 1);
}

From source file:Main.java

public static String getCaptalName(String name) {
    return name.substring(0, 1).toUpperCase() + name.substring(1);
}

From source file:Main.java

public static String returnUpperCaseFirstChar(String name) {
    return name.substring(0, 1).toUpperCase() + name.substring(1);
}

From source file:Main.java

public static String forAppDate(String date) {
    return date.substring(0, date.indexOf("T")).replace("-", "/");
}

From source file:Main.java

public static String getYear(String datenf) {
    return datenf.substring(0, 4);
}

From source file:Main.java

public static String getStamyyyyMMddHHmmss(String stamp) {
    return stamp.substring(0, "yyyy-MM-dd HH:mm:ss".length());
}

From source file:Main.java

public static String getMonth(String datenf) {
    return datenf.substring(4, 6);
}

From source file:Main.java

public static String getFileName(String path) {
    return path.substring(path.lastIndexOf("/") + 1, path.length());
}