Determine if a string is numeric: Difference between revisions
→{{header|AppleScript}}: Added a slightly simpler version.
m (→{{header|APL}}) |
(→{{header|AppleScript}}: Added a slightly simpler version.) |
||
Line 567:
{{Out}}
<lang AppleScript>{false, false, false, true, true, true, true, false, false, false}</lang>
The classic way's slightly simpler, since the coercion result ''must'' be a real or an integer if the coercion itself didn't error.
<lang applescript>on isNumString(s)
if (s's class is not text) then return false
try
s as number
return true
on error
return false
end try
end isNumString</lang>
=={{header|ARM Assembly}}==
|