MaskedString

References
public struct MaskedString
A string with certain characters masked. THIS IS UNFINISHED.

Constructors

MaskedString

#
public MaskedString(string text)
text (string)

Properties

Length

#
public int Length { get; }
Gets the length of te underlying string.

MaskedCount

#
public int MaskedCount { get; }
Counts the number of masked entries

Text

#
public string Text { get; }
Gets the underlying string.

UnmaskedCount

#
public int UnmaskedCount { get; }

Indexers

this[]

#
public (char c, bool mask) this[int index] { get; }
Gets the character and mask state of a specific index.
index (int)

Methods

GrowMask

#
public MaskedString GrowMask()
Return a new masked string whose masked blocks are one character bigger on either end.

IsMasked

#
public bool IsMasked(int index, int length)
Gets whether the characters in the given range are all masked.
index (int)
length (int)

IsMasked

#
public bool IsMasked(int index)
Gets whether the character at the given index is masked.
index (int)

IsNullOrEmpty

#
public bool IsNullOrEmpty()
Gets whether the underlying string is null or empty.

IsNullOrWhiteSpace

#
public bool IsNullOrWhiteSpace()
Gets whether the underlying string is null or only contain whitespace.

MaskAll

#
public MaskedString MaskAll()
Mask all characters.

MaskRange

#
public MaskedString MaskRange(int start, int length)
Mask a range of characters.
start (int)
length (int)

ShrinkMask

#
public MaskedString ShrinkMask()
Return a new masked string whose masked blocks are one character smaller on either end.

Substring

#
public MaskedString Substring(int start, int length)
start (int)
length (int)

Substring

#
public MaskedString Substring(int start)
start (int)

ToLower

#
public MaskedString ToLower()

ToString

#
public override string ToString()

ToUpper

#
public MaskedString ToUpper()

UnmaskAll

#
public MaskedString UnmaskAll()
Unmask all characters.

UnmaskRange

#
public MaskedString UnmaskRange(int start, int length)
Unmask a range of characters.
start (int)
length (int)

Operators

OperationResultDescription
MaskedString&MaskedStringMaskedString'And' two masks together.
MaskedString|MaskedStringMaskedString'Or' two masks together.
!MaskedStringMaskedStringNegate a string mask.

Convertors

OperationResultDescription
implicitstringMaskedString