Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skyehoefling/monkeymask
A simple net standard library to mask strings that are entered in a text input
https://github.com/skyehoefling/monkeymask
maskedinput netstandard string-manipulation uwp wpf xamarin
Last synced: 18 days ago
JSON representation
A simple net standard library to mask strings that are entered in a text input
- Host: GitHub
- URL: https://github.com/skyehoefling/monkeymask
- Owner: SkyeHoefling
- License: mit
- Created: 2018-01-21T02:23:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-24T17:23:56.000Z (over 4 years ago)
- Last Synced: 2024-12-10T00:59:33.437Z (about 1 month ago)
- Topics: maskedinput, netstandard, string-manipulation, uwp, wpf, xamarin
- Language: C#
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# MonkeyMask for NetStandard
Monkey Mask is a simple masking API designed for Xamarin.Forms, UWP, WPF and any platform that supports NetStandard.## Built for User Entry
Monkey Mask was designed for masking strings as they are entered in an Entry field.Suppose you have an Entry Field where you would like to support formatting a phone number (123-456-7890). The library is intended to call it's `MonkeyEntry.Mask()` method with each keystroke so the value appears formatted as they continue to type.
| Final Input | Format |
|----------------|----------------|
| `123-456-7890` | `###-###-####` |1. Input: `1`
2. Input: `12`
3. Input: `123-`
4. Input: `123-4`
5. Input: `123-45`
6. Input: `123-456-`
7. Input: `123-456-7`
8. Input: `123-456-78`
9. Input: `123-456-789`
10. Input: `123-456-7890`### Limitations
Currently MonkeyMask only supports masking digits, we will support alpha numerics in the next release## Setup
* Available on NuGet: [![NuGet](https://img.shields.io/nuget/v/MonkeyMask.svg?label=NuGet)](https://www.nuget.org/packages/MonkeyMask)
* Install into your NetStandard supported project## Build
* [![Build status](https://ci.appveyor.com/api/projects/status/d5ug030xxvhiss1x?svg=true)](https://ci.appveyor.com/project/ahoefling/monkeymask)
* CI NuGet Feed: [https://ci.appveyor.com/nuget/monkeymask](https://ci.appveyor.com/nuget/monkeymask)
### Platform Support
TabStrip is available for use in *Xamarin.Forms* only targetting the following supported platforms.| Platform | Supported | Version |
|------------------|-----------|------------------|
| Xamarin.Android | Yes | NetStandard1.0 |
| Xamarin.iOS | Yes | NetStandard1.0 |
| Xamarin 10 UWP | Yes | NetStandard1.0 |
| WPF | Yes | NetStandard1.0 |
| UWP | Yes | NetStandard1.0 |## Usage ##
#### Static Method ####
```c#
// partial mask
var input = "123-4";
var format = "###-####";
MonkeyEntry.Mask(input, format);// full mask
var input = "123-4567";
var format = "###-####";
MonkeyEntry.Mask(input, format);// full mask and limit a max length
var input = "123-4567";
var format = "###-####";
MonkeyEntry.Mask(input, format, 7);
```#### Extension Method ####
```c#
// partial mask
var input = "123-4";
var format = "###-####";
input.Mask(input, format);// full mask
var input = "123-4567";
var format = "###-####";
input.Mask(input, format);// full mask and limit a max length
var input = "123-4567";
var format = "###-####";
input.Mask(input, format, 7);
```## Created By: [@Andrew_Hoefling](https://twitter.com/andrew_hoefling)
* Twitter: [@Andrew_Hoefling](https://twitter.com/andrew_hoefling)
* Blog: [andrewhoefling.com](http://www.andrewhoefling.com)### License
The MIT License (MIT) see License File