<!DOCTYPE html>
<html>
<head>
<script>
var strM = "javascript is a good script language";
function change(word)
{
return word.charAt(0).toUpperCase()+word.substring(1);
}
alert(strM.replace(/\b\w+\b/g,function(word,i,j,k) {
alert(word);
alert(i);
alert(j);
return word.charAt(0).toUpperCase()+word.substring(1);
}));
</script>
</head>
<body>
</body>
</html>
javascript replace的使用
最新推荐文章于 2025-07-30 16:36:32 发布