用某种符号或字符替换某些字符

第一种:split方法配合join方法

 

第二种:replace方法配合indexOf方法:

 

原文地址:https://www.cnblogs.com/zhang-hong/p/13019747.html