膜拜了,javascript水好深啊
请将All over the world people enjoy sports替换成All1 over2 the3 world4 people5 enjoy6 sports7
大牛的实现:
var i = 0, str = "All over the world people enjoy sports";
str = str.replace(/\S+/g, function($){return $ + [++i]});
alert(str);