我有一个我想转换的字符串.
字符串是图像,内容是:Gone in 60 seconds 我需要的是以下内容:Gone_in_60_seconds 但是当我尝试:image = image.replace(" ","_"); 结果是:Gone_in 60 seconds 所以只有第一个空格被替换.我如何将所有空格转换为下划线?
Gone in 60 seconds
Gone_in_60_seconds
image = image.replace(" ","_");
Gone_in 60 seconds
actionscript-3
actionscript-3 ×1