RE: Standard Euphoria Library Project
Kat,
Please tell me if this program works, or if you get an error about
nothing being assigned to 'test'. It works for me so if it doesn't
work for you, then your Euphoria is broken...
-- save as 'remove.ex' or something like that
sequence test
test = "Kat"
function remove( integer i, sequence s )
-- remove ith element from s
return s[1..i-1] & s[i+1..length(s)]
end function
for i = 1 to length( test ) do
puts( 1, remove( i, test ) & "\n" )
end for
------------------------------------- eof
You should see:
at
Kt
Ka
-- Brian
Kat wrote:
> On 7 Feb 2001, at 10:54, Brian Broker wrote:
>
> > FYI: this is straight out of our friendly refman doc:
> >
> > You can delete element i of any sequence s by concatenating the parts of
> >
> > the sequence before and after i:
> >
> > s = s[1..i-1] & s[i+1..length(s)]
>
> But this would crash for me, with that error about nothing being
> assigned to s to get
> the length of. I am using v2.2, the complete edition, according to Exw.
>
> Kat
|
Not Categorized, Please Help
|
|