Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Forked from dan-manges/gist:430424
Created June 8, 2010 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryanbriones/430455 to your computer and use it in GitHub Desktop.
Save ryanbriones/430455 to your computer and use it in GitHub Desktop.
def mask(x)y=x.dup;y[6,6]='*'*6;y;end
@rab
Copy link

rab commented Jun 8, 2010

Ryan, This changes the referenced string and is not equivalent to Dan's. -Rob

@ryanbriones
Copy link
Author

added #dup in order to not mutate x

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