From: | Sami N��t�nen |
Date: | 15 Jan 2000 at 16:41:04 |
Subject: | Re: odd string length |
On 15-Jan-00, Davide Zipeto wrote.
> Hello Curt
>
> On 15-Gen-00, Curt Esser wrote:
>> I need to determine if a given string is an odd length.
>> Any ideas?
> yep this is the shortest code I've got in my mind...
>
> ------------------
> a$="test string "
> odd=Int(Len(a$)/2)*2-Len(a$)
> If odd = True
> nPrint "string lenght odd"
> Else
> nPrint "string lenght even"
> EndIf
> ------------------
Well my shortest one
if len(a$)&1
NPrint "Length is odd"
else
NPrint "Length is even"
endif
Sami N��t�nen
EMail: sami.naatanen@dlc.fi
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie