var newString = str.replace(/[^A-Z0-9]/ig, "_");. 這將匯致 hello_world___hello_universe. 如果您希望它是單个下划線,請使用+匹配多个.
確定! 回上一頁