MfChar

Namespace ›› System ››
Parent Previous Next

MfChar Class

(Inherits from MfPrimitive)

Represents a character as a UTF-16 code unit.

Links

Fields, Properties, Methods, Example

Constructors


Name

Description

Constructor([c, retunAsObj, readonly])

Initializes a new instance of the MfChar class optionally setting the Value property and the ReturnAsObject property and the Readonly property.

Fields


Name

Description

MaxValue

Gets the largest possible value of an MfChar.

MinValue

Gets the smallest possible value of an MfChar.

Properties


Name

Description

CharCode

Gets or sets the CharCode associated with the this instance of MfChar

IgnoreCase

Gets or sets if the MfChar instance should Ignore case or not.

ReadOnly

Gets the if the derived class will allow the underlying value to be altered after the constructor has been called. Inherited from MfPrimitive

ReturnAsObject

Gets or sets the if the class will return objects as their return value for various functions. Inherited from MfPrimitive

Value

Gets or sets the value associated with the class. Overrides MfPrimitive.Value.

Methods


Name

Description

CompareTo(obj)

Compares this instance to a specified MfChar object.. Overrides MfObject.CompareTo()

Equals(value)

Gets if this instance Value is the same as the value. Overrides MfObject.Equals()

FromCharCode(charCode)

Get a new instance of MfChar from an integer char value

GetHashCode()

Gets A hash code for the current MfChar. Overrides MfObject.GetHashCode()

GetNumericValue(c)

Converts the specified numeric Unicode character to a decimal number for c.

GetNumericValue(s, index)

Converts the specified numeric Unicode character to a decimal number for the character in string s at the location of Zero-based index. Index can be instance of MfInteger or var containing integer.

GetType()

Gets the Type for the for the Class .Inherited from MfObject.

GetTypeCode()

Get an enumeration value of MfTypeCode the represents MfChar Type Code.

GetUnicodeCategory(c)

Categorizes a specified Unicode character into a group identified by one of the MfUnicodeCategory values for c.

GetUnicodeCategory(s, index)

Categorizes a specified Unicode character into a group identified by one of the MfUnicodeCategory values for the character in string s at the location of Zero-based index.

GetValue(c)

Gets the string value from MfChar instance or MfString instance or var containing a string. If string has more then one character then the first character is returned.

GetValue(s, index)

Gets the string value from MfString instance or var containing a string at the location of Zero-based index.

IsControl(c)

Indicates whether the specified Unicode character is categorized as a control character for c.

IsDigit(c)

Indicates whether the specified character of c is categorized as a decimal digit.

IsDigit(s, index)

Indicates whether the specified character is categorized as a decimal digit for the character at position index in s.

IsControl(s, index)

Indicates whether the specified Unicode character is categorized as a control character from MfString instance or var containing a string at the location of Zero-based index.

IsHighSurrogate(c)

Indicates whether the specified character of c is a high surrogate.

IsHighSurrogate(s, index)

Indicates whether the specified character  is a high surrogate that ranges from U+D800 through U+DBFF for the character at position index in s.

IsInstance()

Get if the current class is an instance. Inherited from MfObject.

IsLetter(c)

Indicates whether the specified character of c is categorized as a Unicode letter.

IsLetter(s, index)

Indicates whether the specified character is categorized as a Unicode letter for the character at position index in s.

IsLetterOrDigit(c)

Indicates whether the specified character of c is categorized as a letter or a decimal digit.

IsLetterOrDigit(s, index)

Indicates whether the specified character is categorized as a letter or a decimal digit for the character at position index in s.

IsLower(c)

Indicates whether the specified character of c is categorized as a lowercase letter.

IsLower(s, index)

Indicates whether the specified character is categorized as a lowercase letter for the character at position index in s.

IsLowSurrogate(c)

Indicates whether the specified character of c is a low surrogate.

IsLowSurrogate(s, index)

Indicates whether the specified character is a low surrogate for the character at position index in s.

IsNumber(c)

Indicates whether the specified character of c is categorized as a Unicode number.

IsNumber(s, index)

Indicates whether the specified character is categorized as a Unicode number for the character at position index in s.

IsPunctuation(c)

Indicates whether the specified character of c is categorized as a punctuation mark.

IsPunctuation(s, index)

Indicates whether the specified character is categorized as a punctuation mark for the character at position index in s.

IsSeparator(c)

Indicates whether the specified character of c is categorized as a separator character.

IsSeparator(s, index)

Indicates whether the specified character is categorized as a separator character for the character at position index in s.

IsSurrogatePair(highSurrogate, lowSurrogate)

Indicates whether the two specified MfChar objects form a surrogate pair.

IsSurrogatePair(s, index)

Indicates whether two adjacent characters in a string at a specified position form a surrogate pair.

IsSymbol(c)

Indicates whether the specified character of c is categorized as a symbol character.

IsSymbol(s, index)

Indicates whether the specified character is categorized as a symbol character for the character at position index in s.

IsUpper(c)

Indicates whether the specified character of c is categorized as a uppercase letter.

IsUpper(s, index)

Indicates whether the specified character is categorized as a uppercase letter for the character at position index in s.

IsWhiteSpace(c)

Indicates whether the specified character of c is categorized as white space.

IsWhiteSpace(s, index)

Indicates whether the specified character is categorized as white space for the character at position index in s.

MemberwiseClone()

Creates a shallow copy of the current MfObject instance. Inherited from MfObject.

Parse(s)

Converts the specified string representation of a logical value to its Boolean equivalent, or throws an exception if the string is not equal to the value of TrueString or FalseString.

ToLower(c)

Returns the lowercase equivalent of c, or the unchanged value of c, if c is already lowercase or not alphabetic.

ToLower(s, index)

Returns the lowercase equivalent of the character at position index in s or the unchanged value of character at position index if character is already lowercase or not alphabetic.

ToString()

Gets a string representation of the MfChar instance.. Overrides MfPrimitive.ToString()

ToUpper(c)

Indicates whether the specified character of c is categorized as a uppercase letter.

ToUpper(s, index)

Indicates whether the specified character is categorized as a uppercase letter for the character at position index in s.

TryParse(byref result, s)

Converts the value of the specified string to its equivalent Unicode character. A return code indicates whether the conversion succeeded or failed.

Example

UserInput := Mfunc.InputBox("Byte Value", "Enter a single character", , 300, 140)
if (ErrorLevel)
{
   MsgBox, CANCEL was pressed.
}
else
{
   try
   {
       ch := new MfChar(UserInput)
       if (MfChar.IsDigit(ch))
       {
           MsgBox, 64, Digit, You entered a Digit
       }
       else if (MfChar.IsLetter(ch))
       {
           if (MfChar.IsUpper(ch))
           {
               MsgBox, 64, Upper, You entered an upper case letter
           }
           else if (MfChar.IsLower(ch))
           {
               MsgBox, 64, Lower, You entered a lower case letter
           }
       }
       else if (MfChar.IsWhiteSpace(ch))
       {
           MsgBox, 64,, Whitespace, You entered a whitespace character
       }
       else
       {
           MsgBox, 64, Char Code, % MfString.Format("You enter a character with a char code of {0}", ch.CharCode)
       }
   }
   catch
   {
       MsgBox, 16, Bad Input, The input was not acceptable.
   }
}