def rot_encode(s, offset=2)
s.split('').map{ |char| (char.ord + offset).chr }.join
end
Ruby rot encode
Rotation encoding with vari...
package engine; import junit.framework.Assert; ...
Java Refactor, fix and optimize ...
by programmer-offsite,
April 20, 2009 14:15,
5 refactorings, tagged with java, refactor, strings, character, optimize
While tuning the applicatio...
char **split (char *string, char sep, char escape) {
char **ret = NULL;
...
C A Java-like function split
This function splits a stri...
data = data.gsub("\xA0", " ")
data = data.gsub("\x99", "(TM)")
data = data.gsub("\x97", "-")
...
Ruby simplify multiple gsub
I could put the search/repl...
Looking for a more succinct...