Anonymous user
Determine if a string is numeric: Difference between revisions
→{{header|APL}}
m (→{{header|APL}}) |
|||
Line 493:
{{works with|Dyalog APL}}
<lang apl> ⊃⎕VFI{w←⍵⋄((w='-')/w)←'¯'⋄w}'152 -3.1415926 Foo123'
1 1 0</lang>
Works with more recent versions of <B>Dyalog APL</B>
<lang apl> ⊃⎕VFI {'¯' @ ('-'∘=) ⊣⍵} '152 -3.1415926 Foo123' ⍝ Fast: replacement of - with APL high-minus required for ⎕VFI ▼
▲ ⊃⎕VFI {'¯' @ ('-'∘=) ⊣⍵} '152 -3.1415926 Foo123' ⍝ Fast: replacement of - with APL high-minus
1 1 0
⊃⎕VFI '-' ⎕R '¯' ⊣ '152 -3.1415926 Foo123'
1 1 0</lang>
|