From: snacktime Date: 2006-08-13T05:33:22+09:00 Subject: ruby equiv of perl pos Or to be more exact, how would I do the following in ruby? while ($string =~ /\0/g) { $new_string .= sprintf '\%o', (pos $string) - 1; }