JAVA
小白菜PK小豆丁
这个作者很懒,什么都没留下…
展开
-
BASE64编号 转压缩包避免常量过长问题
1、BASE64编号 转压缩包避免常量过长问题。//base64转压缩包。原创 2022-12-29 09:16:42 · 851 阅读 · 0 评论 -
String转List<long>
List<Long> listIds = Arrays.asList(ids.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());原创 2021-05-31 17:42:22 · 2427 阅读 · 0 评论 -
jdk8 2条 List并行循环
1、orElse(null)) 如果不相同用null 代替List<Test> collectTest = testsList.stream().map(map -> reportResults.stream().filter(m -> Objects.equals(m.getItemName(), map.getItemName())).findAny().map(m -> { if (map.getItemName().equals(m.getItemName(.原创 2021-05-01 19:53:56 · 544 阅读 · 0 评论 -
时间查询 Calendar 30天内
1、获取30天内Calendar calendar = Calendar.getInstance();calendar.setTime(new Date());calendar.add(Calendar.DAY_OF_MONTH, -30); //30天内原创 2021-05-01 19:51:03 · 258 阅读 · 0 评论 -
JAVA定时任务
@Componentpublic class SendMsgScheduler { private static Logger LOG = LoggerFactory.getLogger(SendMsgScheduler.class); WebMvcConfigurationSupport erg; @Scheduled(cron = "*/5 * * * * ?") public void sendMsg() { try { } catch (Ex.原创 2020-10-29 09:39:49 · 93 阅读 · 0 评论 -
JAVA 逗号换成双引号
逗号换成双引号String order_prn_ = "'" + StringUtils.join(order_prn.split(","), "','") + "'";原创 2020-10-21 10:30:40 · 396 阅读 · 0 评论 -
List 转数组、数组转双引号
1、list转数组List<String> taskPrns = new ArrayList<>();taskPrns.add("1");taskPrns.add("2");taskPrns.add("3");System.out.println(StringUtils.strip(taskPrns.toString(),"[]"));2、数组转双引号String str="1,2,3,4";String sample_prn_id = "'" + StringU.原创 2020-10-14 12:26:50 · 1305 阅读 · 0 评论 -
2020-09-28
String prns = "'" + StringUtils.join(taskPrns, "','") + "'";原创 2020-09-28 09:00:40 · 57 阅读 · 0 评论 -
StringBuilder 拼接去掉最后一个逗号
1、StringBuilder 拼接去掉最后一个逗号/** * String 逗号切割 * * @param value * @return */public String strValue(String value) { String[] strs = value.split(","); StringBuilder sb = new StringBuilder(); for (String str : strs) { sb.append(str).a.原创 2020-09-21 11:34:16 · 6288 阅读 · 0 评论 -
JAVA 数组字符串去重
public static void main(String[] args) { String str="a,b,c,a,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"; System.out.println(deduplication(str));}public static String deduplication(String v) { if (!StringUtils.isEmpty(v)) { Strin.原创 2020-09-21 09:30:21 · 782 阅读 · 0 评论 -
JAVA 字符串数组逗号-删除
public static void main(String[] args) { String str="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"; String str1="a,b,e"; String[] strArray=null; strArray = convertStrToArray(str1); System.out.println(delElement(str,strArray));.原创 2020-09-19 09:01:12 · 1796 阅读 · 0 评论 -
JAVA 符串为null,则返回““
一、对字符串去除空格,如果字符串为null,则返回""/** * 对字符串去除空格,如果字符串为null,则返回"" * @param str :输入字符串 * @return :trim后结果 */ public static String trim(String str) { if (null == str) { return ""; } return str.trim();...原创 2020-09-02 21:43:47 · 2371 阅读 · 0 评论 -
JAVA 字符串的加减乘除 不包含括号
package com.lyjplus.app.modular.ceshi;/** * @description: * @author: longyj * @create: 2020-04-21 21:14 **/public class Test { public static void main(String[] args) { /** ...原创 2020-04-21 23:24:51 · 495 阅读 · 0 评论