GitHub 6248★

Check if a string is an octal number

JavaScript version

const isOctal = (str) => /^(0o)?[0-7]+$/i.test(str);

TypeScript version

const isOctal = (str: string): boolean => /^(0o)?[0-7]+$/i.test(str);
Follow me on and to get more useful contents.