Skip to content

Instantly share code, notes, and snippets.

@kcurtin
Created November 4, 2012 16:25
Show Gist options
  • Save kcurtin/4012489 to your computer and use it in GitHub Desktop.
Save kcurtin/4012489 to your computer and use it in GitHub Desktop.
sexy string conversion
original = 'g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.'
original.each_char.each_with_object("") do |character, final|
character.next!.next! unless character.match /\W/
final << character
end
@xta
Copy link

xta commented Nov 4, 2012

nice, i have no idea how this works, but i think original needs to be wrapped with double quotes (")?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment