1. RE: Looking for the best "JOIN"

Have I missed something?
Surely this is built in to Euphoria as a fundamental?

sequence x

x = "abc"&"def"&"ghijk"

 ... and d then = "abcdefghijk"

I just tried it and it does ... so?

Andy


euman at bellsouth.net wrote:
> Im looking for the best JOIN method.
> 
> Heres what I have:   {"str1","str2","str3"}
> 
> Heres what I want:   "str1str2str3"
> 
> No slow ideas please>>>>
> 
> Euman
> euman at bellsouth.net
> 
>

new topic     » topic index » view message » categorize

2. RE: Looking for the best "JOIN"

Sorry, did I fail to be obvious? What about:

function Join(squence strings)


Derek Parnell wrote:
> Unsaid in Euman request, but assumed by others is the desire to find a
> method of joining an abitary number of strings. The exact number would 
> not
> be known until run-time.
> 
> If we were to take Euman's request a face value the answer might be ...
> 
> 
>   function join()
>      return "str1str2str3"
>   end function
> 
> because that is literally what he asked for, 'Heres what I want:
> "str1str2str3"'.
> 
> ----- Original Message -----
> From: "Andy Drummond" <kestrelandy at xalt.co.uk>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, October 22, 2001 10:54 PM
> Subject: RE: Looking for the best "JOIN"
> 
> 
> > Have I missed something?
> > Surely this is built in to Euphoria as a fundamental?
> >
> > sequence x
> >
> > x = "abc"&"def"&"ghijk"
> >
> >  ... and d then = "abcdefghijk"
> >
> > I just tried it and it does ... so?
> >
> > Andy
> >
> >
> > euman at bellsouth.net wrote:
> > > Im looking for the best JOIN method.
> > >
> > > Heres what I have:   {"str1","str2","str3"}
> > >
> > > Heres what I want:   "str1str2str3"
> > >
> > > No slow ideas please>>>>
> > >
> > > Euman
> > > euman at bellsouth.net
> > >
> > >

new topic     » goto parent     » topic index » view message » categorize

3. RE: Looking for the best "JOIN"

Whoops!
I was trying to say, try this:

function join (sequence strings)
   sequence result
   result = ""
   for i=1 to length(strings)
      result = result & strings[i]
   end for
   return result
end function

I just wrote exactly that and it seems perfectly satisfactory.
So what have I missed that's so obvious to y'all out there?


Derek Parnell wrote:
> Unsaid in Euman request, but assumed by others is the desire to find a
> method of joining an abitary number of strings. The exact number would 
> not
> be known until run-time.
> 
> If we were to take Euman's request a face value the answer might be ...
> 
> 
>   function join()
>      return "str1str2str3"
>   end function
> 
> because that is literally what he asked for, 'Heres what I want:
> "str1str2str3"'.
> 
> ----- Original Message -----
> From: "Andy Drummond" <kestrelandy at xalt.co.uk>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, October 22, 2001 10:54 PM
> Subject: RE: Looking for the best "JOIN"
> 
> 
> > Have I missed something?
> > Surely this is built in to Euphoria as a fundamental?
> >
> > sequence x
> >
> > x = "abc"&"def"&"ghijk"
> >
> >  ... and d then = "abcdefghijk"
> >
> > I just tried it and it does ... so?
> >
> > Andy
> >
> >
> > euman at bellsouth.net wrote:
> > > Im looking for the best JOIN method.
> > >
> > > Heres what I have:   {"str1","str2","str3"}
> > >
> > > Heres what I want:   "str1str2str3"
> > >
> > > No slow ideas please>>>>
> > >
> > > Euman
> > > euman at bellsouth.net
> > >
> > >

new topic     » goto parent     » topic index » view message » categorize

4. RE: Looking for the best "JOIN"


new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu