I noticed that my "different take" (see the bottom
of this message) ignored the need for "spaces", as well, and
have attempted to revise my "different take", but in doing
so, I have relied on the verb "stringreplace" from the
script "strings".

t      =: 'aabccdeeeeefefefaaafff'
first1 =: 2 </\0,]
mask   =: 0 0,2*./\2=/\]

spanold=: ((   a: ,<'</span>'){~(first1&.|.)),:(a:,<'<span>'){~first1
span   =: (((<'M'),<'</span>'){~(first1&.|.)),:(a:,<'<span>'){~first1

load'strings' NB. ******next line produces the result****
('M<';'<';'M';' ')stringreplace ;|:2 0 1{(<"0,span&mask)t



On Fri, 11 Jul 2008, Brian Schott wrote:

        Another slightly different take:


   first1 =: 2 </\0,]
   mask   =: 0 0,2*./\2=/\]
   span   =: ((a:,<'</span>'){~(first1&.|.)),:(a:,<'<span>'){~first1
   ;|:2 0 1{(<"0,span&mask)t



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

Reply via email to