Anonymous user
Determine if a string is numeric: Difference between revisions
m
→{{header|APL}}
(→{{header|Wren}}: Library name change.) |
m (→{{header|APL}}) |
||
Line 493:
{{works with|Dyalog APL}}
<lang apl> ⊃⎕VFI{w←⍵⋄((w='-')/w)←'¯'⋄w}'152 -3.1415926 Foo123'
1 1 0</lang>
<lang apl>
⍝ Use more recent features @ or ⎕R
⊃⎕VFI {'¯' @ ('-'∘=) ⊣⍵} '152 -3.1415926 Foo123' ⍝ Fast: replacement of - with APL high-minus
1 1 0
⊃⎕VFI '-' ⎕R '¯' ⊣ '152 -3.1415926 Foo123' ⍝ Simple: (ditto)
1 1 0</lang>
|