Restrição alfanumérica

Published by SyntaxGardener in

Crie uma função que retorne true quando uma string contiver apenas letras do inglês ou dígitos ASCII.

Retorne false quando ela contiver letras e dígitos ao mesmo tempo, espaços ou símbolos, ou estiver vazia.

Exemplos

Program.AlphanumericRestriction("Bold") ➞ true

Program.AlphanumericRestriction("123454321") ➞ true

Program.AlphanumericRestriction("H3LL0") ➞ false

Program.AlphanumericRestriction("ed@bit") ➞ false