On Oct 13, 10:32=A0am, Robert Klemme <shortcut... / googlemail.com> wrote:
> On Wed, Oct 13, 2010 at 3:54 PM, Intransition <transf... / gmail.com> wrote=
:
> > String::Mask is a library I created not for a specific use case, but
> > simply b/c it had a certain logical sense to it. However, to this day
> > I have not conceived of any need for it. I'm wondering if anyone else
> > can think of a case where it might be useful.
>
> > I created a QED file which explains it pretty well:
>
> Frankly, from the description it's not clear to me what this is
> supposed to do. =A0What is the string, what is the mask and what does
> the mask do? =A0Apparently there are operations available on masks but
> how do I apply a mask - and what to? =A0And what's the result of
> applying a mask to something? =A0What does escaping do?

Fair point.

The library defines logical operations for string content. You can use
it to "mask" strings is various ways. I guess the simplest example I
can think of is blacking-out a credit card number.

  "4111-1234-1234-1234".mask('_') + "____-XXXX-XXXX-XXXX".mask('_')

  #=3D> "4111-XXXX-XXXX-XXXX"

The "escape character" is just what ever "empty slot" character you
want to use, in this case we are using '_'.

Does that make it a little clearer?