js split(" ").join(" ");
时间: 2023-08-08 11:06:50 浏览: 91
JS split() 分割字符串
在JavaScript中,split(" ")方法用于将一个字符串按照空格分割成一个字符串数组,而join(" ")方法则用于将数组中的所有元素用空格连接成一个字符串。所以,js split(" ").join(" ")的作用是将一个字符串按照空格分割成一个字符串数组,然后再用空格连接成一个新的字符串。
#### 引用[.reference_title]
- *1* [JavaScript:split() 方法和join() 方法](https://blog.csdn.net/KaiSarH/article/details/103250382)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [this.message.split(‘‘).reverse().join(‘‘)是什么意思?(用官方文档例子分析)](https://blog.csdn.net/weixin_54614831/article/details/126289293)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [split().reverse().join()用法](https://blog.csdn.net/weixin_43592907/article/details/106677696)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文