isascii
Tests if every character of given strings is 7-bit US-ASCII
Syntax
res = isascii(str)
Arguments
- str
a character string or an array of integers.
- res
a boolean matrix.
Description
res = isascii(str)
returns %t
(TRUE) if entries of str
are a 7-bit
US-ASCII character code between 0 and octal 0177 inclusive (or
entries of str
are 7-bit US-ASCII characters).
Otherwise returns %f
(FALSE).
Examples
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 = "γ²β²"
See also
- ascii — string ASCII conversions
- isalphanum — check that characters of a string are alphanumerics
- isdigit — check that characters of a string are digits between 0 and 9
- isletter — check that characters of a string are alphabetic letters
- isnum — tests if a string represents a number
Report an issue | ||
<< isalphanum | Strings | isdigit >> |