Hello,

I've been using J for a while, and to my great shame, I can't wrap my
head around this one. This is supposed to be easy. Maybe I'm just tired.

Excuses aside, this is what I want to do.

Given vector "lengths" containing n integers, and variable "tobecut",
either a vector of characters or numbers. And given that (+/lengths) =
#tobecut.

I want a verb v which will cut "tobecut" by length.

For example:

   lengths =: 4 2 5
   tobecut =: 'abcdefghijk'

   lengths v tobecut
+----+--+-----+
|abcd|ef|ghijk|
+----+--+-----+

Of course, the fastest, the better.

Thanks,

BM
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to