Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * http://36kr.com/p/5040401.html-->5040401
     * @param pStr
     * @return
     */
    public static String getArticleId(String pStr) {
        String tempStr = pStr.substring(pStr.lastIndexOf("/") + 1);
        if (tempStr.contains(".")) {
            String[] temp = tempStr.split("\\."); //  5040196
            return temp[0];
        }
        return pStr;
    }
}