Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextUtils;

public class Main {
    public static String interceptStringOfIndex(String str, int index) {
        String intercept = str;

        if (TextUtils.isEmpty(str)) {
            return str;
        }

        if (str.length() > index) {
            intercept = str.substring(str.length() - index, str.length());

        }

        return intercept;
    }
}