注意Java和JavaScript去掉字符串最后一个字符常用写法的区别

1 java
String tempAvailableTime="1,2,";
tempAvailableTime = tempAvailableTime.substring(0,tempAvailableTime.length() - 1);

2 JavaScript

let reStr = "1,2,";
reStr = reStr.substring(0,reStr.length - 1);

  

posted @ 2020-11-13 10:11  Samuel-Leung  阅读(71)  评论(0编辑  收藏  举报