JS字符串与数组的相互转换
发布日期:2021-05-14 09:31:32 浏览次数:15 分类:博客文章

本文共 936 字,大约阅读时间需要 3 分钟。

JS���������������������������������

���������������������������������������������������string������������������������������������������������

���������������������

1���������������������������

//customerLabelName="���������������������������������"������split���������������������var customerLabelNameResult = data[i].customerLabelName.split("���");var customerLabelColorNameResult = data[i].customerLabelColorName.split("���");//������������������customerLabelNameResult:���������,���������,���������console.log("customerLabelNameResult:" + customerLabelNameResult);for (let j = 0; j < customerLabelNameResult.length; j++) {    html += "
" + customerLabelNameResult[j] + "
"}

2���������������������������

//customerLabelNameResult=[���������,���������,���������]var arrayToString = customerLabelNameResult.join(';');//������������������arrayToString:���������;���������;���������console.log("arrayToString:" + arrayToString);
上一篇:JS截取特定位置的子字符串
下一篇:synchronized与volatile关键字详解

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年04月07日 05时44分11秒