<slap head> i'm sorry- wrong group- but it was very helpfull anyways!
Thanks
Marco


On Jun 24, 11:01 pm, tobie <[EMAIL PROTECTED]> wrote:
> well... this *is* the prototype mailing list...
>
> On Jun 24, 4:45 pm, Marco Kotrotsos <[EMAIL PROTECTED]> wrote:
>
>
>
> > hey great- thanks...
>
> > i'm getting an error though
>
> >  split.rb:1: undefined method `without' for ["", "a982", "", "k298",
> > "", "e863", "", "q982"]:Array (NoMethodError)
>
> > should i include a library? What does .without do exactly?
> > again , thanks alot!
> > Marco
>
> > On Jun 24, 10:25 pm, tobie <[EMAIL PROTECTED]> wrote:> 
> > 'a982k298e863q982'.split(/(.{4})/).without('') is the only thing I can
> > > think of for now using split
>
> > > The other solution being of course:
>
> > > 'a982k298e863q982'.toArray().inGroupsOf(4).invoke('join', '')
>
> > > Hope this helps,
>
> > > Tobie
>
> > > On Jun 24, 4:06 pm, Marco Kotrotsos <[EMAIL PROTECTED]> wrote:
>
> > > > Hey goodevening,
>
> > > > I am struggling with this:
>
> > > > i have a long string
>
> > > > a982k298e863q982
>
> > > > I am wondering if it would be possible (i've searched but no luck) to
> > > > use split to parse the 4 products contained in this string to get
>
> > > > ["a982","k298","e863","q982"]
>
> > > > every product is alway's 4 characters long.
> > > > Is string.split the way to go- or should I just process the string
> > > > character by character?
>
> > > > Thanks a million!!
> > > > kind regards,
> > > > Marco Kotrotsos- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to