Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
explode() and implode()
#11
Quote:red_marvin: remember to add back in the separator Wink

What do you mean?

something like:

Code:
FUNCTION implode(string_array(),separator)
  DIM st$=""
  FOR n = LBOUND(string_array()) TO UBOUND(string_array())
    st$=st$+string_array(n)
    IF n<>UBOUND(string_array$) THEN st$=st$+chr$(separator)   '<<==
  NEXT
  implode=st$
END FUNCTION

...or just the fact that I forgot to return the string value
-> implode=str$

?

Well I modified for both...
/post]
Reply
#12
i made a duplicate of perls SPLIT function which seems to work exactly like you're challenging us. It's at the code post. There are some bugs in that version though, which i've recently fixed.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#13
I'm a lazy sod. Post it here if you wanna win Tongue

edit: sterling's entry:

still does exploding if I use two spaces for seperating " " instead of one " ", when the gaps in the string are only one space wide.

But it looks good so far Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)