34 lines
847 B
Java
34 lines
847 B
Java
import com.couplet.vehicle.utils.SnowflakeIdGenerator;
|
|
|
|
/**
|
|
* @ProjectName: five-groups-couplet
|
|
* @Author: LiuYunHu
|
|
* @CreateTime: 2024/3/27
|
|
* @Description:
|
|
*/
|
|
|
|
public class IdTest {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
|
|
|
long l = idGenerator.nextId();
|
|
String s = "VIN" + l;
|
|
System.out.println(l);
|
|
System.out.println(s);
|
|
System.out.println("剪切前长度:" + s.length());
|
|
|
|
|
|
String last17 = s.substring(s.length() - 17);
|
|
System.out.println("剪切后:"+last17+" 长度:"+last17.length());
|
|
|
|
|
|
System.out.println("----------------------");
|
|
|
|
String s1 = "1224069209961664512";
|
|
String substring = s1.substring(s1.length() - 17);
|
|
System.out.println(substring);
|
|
}
|
|
}
|