b=:'DSC0001.JPG'
b e. (48+i.10){a.
0 0 0 1 1 1 1 0 0 0 0
id=: 13 :'y e. (48+i.10){a.'
id b
0 0 0 1 1 1 1 0 0 0 0
id
'0123456789' e.~ ]
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ric Sherlock
Sent: Thursday, November 24, 2011 8:42 PM
To: Programming forum
Subject: Re: [Jprogramming] Digit identifier verb or phrase?
for what you want to do the following is probably sufficient:
isdigit=: e.&'0123456789'
isdigit 'DSC0001.JPG'
0 0 0 1 1 1 1 0 0 0 0
On Fri, Nov 25, 2011 at 1:13 PM, Ric Sherlock <[email protected]> wrote:
> open 'validate'
> load 'validate'
>
> On Fri, Nov 25, 2011 at 10:12 AM, PackRat <[email protected]> wrote:
>> I could have sworn that there were various "is..." verbs or phrases
>> that identified digits, alpha chars, punctuation, etc., in literals,
>> but I can't seem to locate them at all. (I still use J602; waiting for
>> the J701 bleeding edge blood to stop.)
>>
>> Basically, what I'm immediately looking for is a verb or phrase (I'll
>> call it "isdigit") that gives a boolean 1 for each char in a literal
>> that's a digit and 0 otherwise:
>>
>> isdigit 'DSC0001.JPG' ---> 00011110000
>>
>> D S C 0 0 0 1 . J P G
>> 0 0 0 1 1 1 1 0 0 0 0
>>
>> I tried comparisons with values in a. but, for whatever reason, that
>> didn't work because it seemed to compare the whole literal at once
>> rather than a char-by-char comparison.
>>
>> Thanks in advance for your assistance with this!
>>
>>
>> Harvey
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm