SOURCE

function getNum(stringCount) {
            var numCount = 0;
            for (var i = 0; i < stringCount.length; i++) {
                var char = stringCount.charAt(i);
                if (char != " " && !isNaN(char)) {
                    numCount++;
                }
            }
            return numCount;
        }
        document.write(getNum("2022316yyyxy"));
console 命令行工具 X clear

                    
>
console