java的string方法使用

1、将list转换为“,”隔开的字符串

//videoIdList值转换成 1,2,3
 String videoIds = StringUtils.join(videoIdList.toArray(), ",");

 

2、取字符串的开始到最后 "." ;如(01.03.09.mp4 取后就为:01.03.09

 String title = fileName.substring(0, fileName.lastIndexOf("."));

 

posted @ 2020-09-14 15:37  糊涂蜗牛  阅读(232)  评论(0编辑  收藏  举报