
工具类
文章平均质量分 82
工具类
27号白开水
这个作者很懒,什么都没留下…
展开
-
EasyExcel + Vue +Springboot 前后端联动,快捷导出Excel文件
预期效果:前后台联动,即点击“导出Excel”按钮后弹出下载框导出效果:1. 引入依赖<dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> <version>2.1.6</version></dependency>2. 创建实体类@Datapublic class WeekProP原创 2021-06-04 10:13:46 · 7156 阅读 · 15 评论 -
截取字符串的后半部分(以某字符为标志位)
如 String location = “中国-山东-济南-天桥区”,希望获得最后一个“-”后面的区级名称1、按照“-”拆分成字符串数组,然后取数组的最后一个值String[] area = location.split("-");String lastOne = area[area.length-1];2、找到最后一个“-”的位置,然后截取字符串String lastOne = location.substring(location.lastIndexOf('-') + 1);其中 St原创 2020-07-01 13:51:27 · 2160 阅读 · 1 评论 -
判断字符串是否以指定的前缀开始(以什么开头)
public boolean startsWith(String prefix, int toffset)或public boolean startsWith(String prefix)其中:prefix – 前缀。toffset – 字符串中开始查找的位置。返回值为true 或 false。例:String startCode = "北京欢迎您";System.out.println(startCode.startsWith("北京"));System.out.println(原创 2020-05-30 10:54:48 · 3970 阅读 · 1 评论