Project

strmask

0.0
No commit activity in last 3 years
No release in over 3 years
String::Mask provides a kind-of string algebra useful for manipulating strings in comparitive ways, eg. add, subtract, xor, etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

String::Mask¶ ↑

Homepage | Source Code

<img src=“http://travis-ci.org/rubyworks/strmask.png” />

DESCRIPTION¶ ↑

Mask provides a string utility to manipulate strings in logicomathematical manner, ie. add, subtract, xor, etc.

SYNOPSIS¶ ↑

Mask objects can be created explicitly via #new.

m1 = String::Mask.new("abc..123", '.')
m2 = String::Mask.new("ab..789.", '.')
m1 - m2                             #=> "....789."

But the String#mask extension is much easier to use.

m1 = "abc..123".mask('.')
m2 = "ab..789.".mask('.')
m1 * m2                             #=> "ab..789."

The second operand can be a normal String. Mask will assume it repesents another mask akin to the first.

"abc..123".mask('.') + "ab..789."   #=> "abc.7893"

INSTALL¶ ↑

To install with RubyGems simply open a console and type:

$ gem install strmask

COPYRIGHTS¶ ↑

Copyright © 2009 Thomas Sawyer, Rubyworks

This program is ditributed unser the terms of the FreeBSD license.

See the NOTICE.rdoc file for details.