//1、如果有一个字符串"Rome was not built in a day"
//请用程序统计该字符串中字符个数,不允许使用字符串对象的length属性。
var str ="Rome was not built in a day";
arr =str.replace(/\s/g);//去掉所有的空格
var sum =0;
for(var i of str)
{
sum++;
}
document.write(sum);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
</style>
<script>
</script>
</head>
<body>
</body>
</html>