Class CharFormatDataString
- Namespace
- SunamoString._public.SunamoData.Data
- Assembly
- SunamoString.dll
Defines formatting rules for character validation including case, required characters, and length constraints.
public class CharFormatDataString
- Inheritance
-
CharFormatDataString
- Inherited Members
- Extension Methods
Constructors
CharFormatDataString()
Initializes a new empty instance with default values.
public CharFormatDataString()
CharFormatDataString(bool?, char[])
Initializes a new instance with the specified case constraint and required characters.
public CharFormatDataString(bool? isUpper, char[] mustBe)
Parameters
isUpperbool?Whether characters should be uppercase. Null means no constraint.
mustBechar[]Array of characters that must be present.
Properties
FromTo
Range specification for character count (min/max length).
public FromToString? FromTo { get; set; }
Property Value
MustBe
Array of characters that must be present.
public char[]? MustBe { get; set; }
Property Value
- char[]
Upper
Indicates if characters should be uppercase. Null means no constraint.
public bool? Upper { get; set; }
Property Value
- bool?
Methods
Get(bool?, FromToString, params char[])
Creates a CharFormatDataString with the specified constraints.
public static CharFormatDataString Get(bool? isUpper, FromToString fromTo, params char[] mustBe)
Parameters
isUpperbool?Whether characters should be uppercase. Null means no constraint.
fromToFromToStringThe required length range.
mustBechar[]Characters that must be present.
Returns
GetOnlyNumbers(FromToString)
Creates a CharFormatDataString that only allows numeric characters within the specified length range.
public static CharFormatDataString GetOnlyNumbers(FromToString requiredLength)
Parameters
requiredLengthFromToStringThe required length range.