isascii
Testa se cada caractere de strings fornecidas é do tipo 7-bit US-ASCII
Seqüência de Chamamento
res = isascii(str)
Parâmetros
- str
string
- res
uma matriz de booleanos
Descrição
res = isascii(str) retorna verdadeiro (%T) se c é
um código 7-bit US-ASCII entre 0 e 0177 octal, inclusive. Caso contrário,
retorna falso (%F).
Exemplos
isascii("Señor") nt = ascii("Señor") isascii(nt) t = "We know that γ² = 1/(1-β²)"; isascii(t) part(t, find(~isascii(t)))
--> isascii("Señor")
ans =
T T F T T
--> nt = ascii("Señor")
nt =
83. 101. 195. 177. 111. 114.
--> isascii(nt)
ans =
T T F F T T
--> t = "We know that γ² = 1/(1-β²)";
--> isascii(t)
ans =
T T T T T T T T T T T T T F F T T T T T T T T F F T
--> part(t, find(~isascii(t)))
ans =
"γ²β²"
Tabs, New lines, etc are special but anyway US-ascii characters. Non-breakable spaces char(160) are not US-ascii:
--> t = "a" + char(160) + "b" + ascii(9) + " EOL:" + ascii(10) + "Next" t = "a b EOL: Next" --> isascii(t) ans = T F T T T T T T T T T T T T --> ascii(t) ans = 97. 194. 160. 98. 9. 32. 69. 79. 76. 58. 10. 78. 101. 120. 116.
Ver Também
- ascii — conversão ASCII de strings
- isalphanum — verifica se os caracteres de um string são alfanuméricos
- isdigit — checa se os caracteres de um string são números entre 0 e 9
- isletter — verifica se os caracteres de um string são letras do alfabeto
- isnum — testa se um string representa um número
| Report an issue | ||
| << isalphanum | Cadeias de Caracteres (Strings) | isdigit >> |