Fra*_*ank 6 javascript lowercase uppercase
我想在一个字符串中添加小写和大写之间的空格.例如:
FruityLoops
FirstRepeat
Run Code Online (Sandbox Code Playgroud)
现在我想在小写和大写字母之间添加一个空格.我不知道如何从JavaScript开始.有什么东西用substr或搜索?有人可以帮帮我吗?
use*_*716 19
var str = "FruityLoops";
str = str.replace(/([a-z])([A-Z])/g, '$1 $2');
Run Code Online (Sandbox Code Playgroud)
示例: http ://jsfiddle.net/3LYA8/