uniq chars by rolf

 (%stdin)(r)file 999 string readline not{exit}if /s exch def
 s length /l exch def
 /t 999 string def
 /k 0 def
 0 1 l 1 sub {
  /i exch def
  /f true def
  0 1 i 1 sub {
   /j exch def
   s i get s j get eq { /f false def } if
  } for
  f {s i get t exch k exch put k 1 add /k exch def} if
 } for
 t 0 k getinterval =

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page