[Jprogramming] replace/amend elements based on certain criteria ?

gary ng garyng2000 at gmail.com
Mon Sep 6 01:05:27 HKT 2010


Hi,

What would be the recommended way to do this , say replace every
element that is odd to '_1' ?

0 1 2 3 4 => 0 _1 2 _1 4

I tried to under stand the 'm } ' verb but don't know how to generate
the m based on a predicate.

similarly how about replace the first n  with _1 ?


More information about the Programming mailing list