字符串拼接中去除最后一个;号

 

1 for(var i = 0; i<$scope.viewProject.projectLineList.length; i++){
2     $scope.projectLineList += $scope.viewProject.projectLineList[i].lineName + ' ; ';
3 }
4 $scope.projectLineList=$scope.projectLineList.substring(0,$scope.projectLineList.length-2)

效果如下所示:

第二排数据为去除之后的效果展示

posted @ 2018-08-23 16:30  呀,西蓝花  阅读(233)  评论(0编辑  收藏  举报