MfString

Namespace ›› System ››
Parent Previous Next

MfString Class

(Inherits from MfPrimitive)

Represents string object

Links

Fields, Properties, Methods, Related, Example

Constructors


Name

Description

Constructor([str, retunAsObj, read-only])

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

Fields


Name

Description

Empty

Gets the value associated with empty string

Properties


Name

Description

IgnoreCase

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

Index[i]

Gets a single character from the MfString at zero-based index i.

Length

Gets the length of the Value property.

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 MfString class will return objects as their return value for various functions. Inherited from MfPrimitive

Value

Gets or sets the value associated with the this instance. Overrides MfPrimitive.Value.

Methods


Name

Description

Append(value)

Appends value string to current MfString instance.

AppendLine()

Appends a new line represented by MfEnvironment.NewLine to current MfString instance.

AppendLine(Value)

Append value followed by a new line represented by MfEnvironment.NewLine to current MfString instance.

Compare(objParams)

Compares two string base up the Parameters passed into the MfParams object.

Compare(strA, strB)

Compares two specified MfString objects and returns an Integer that indicates their relative position in the sort order.

Compare(strA, strB, ignoreCase)

Compares two specified MfString objects, ignoring or honoring their case, and returns an Integer that indicates their relative position in the sort order.

Compare(strA, strB, comparisonType)

Compares two specified MfString objects using the specified rules, and returns an Integer that indicates their relative position in the sort order.

Compare(strA, indexA, strB, indexB, length)

Compares substrings of two specified MfString objects and returns an Integer that indicates their relative position in the sort order.

Compare(strA, indexA, strB, indexB, length, ignoreCase)

Compares substrings of two specified MfString objects, ignoring or honoring their case, and returns an Integer that indicates their relative position in the sort order.

CompareTo(obj)

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

Concat(args*)

Creates the string representation of a specified objects.

Contains(searchChar)

Reports if there is an occurrence of a character specified by searchChar within this instance.

Contains(searchChar, startIndex)

Reports if there is an occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex.

Contains(searchChar, startIndex, count)

Reports if there is an occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex and examines a  number of character positions specified by count.

Contains(strSearch)

Reports if there is an occurrence of a string specified by strSearch within this instance.

Contains(strSearch, startIndex)

Reports if there is an occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position.

Contains(strSearch, startIndex, count)

Reports if there is an occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

Contains(strMain, searchChar)

Reports if there is an occurrence of a character specified by searchChar within strMain.

Contains(strMain, searchChar, startIndex)

Reports if there is an occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position.

Contains(strMain, searchChar, startIndex, count)

Reports if there is an occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

Contains(strMain, strSearch)

Reports if there is an occurrence of a string specified by strSearch within strMain.

Contains(strMain, strSearch, startIndex)

Reports if there is an occurrence of a string specified by strSearch within strMain. The search starts at character position specified by startIndex.

Contains(strMain, strSearch, startIndex, count)

Reports if there is an occurrence of a string specified by strSearch within strMain. The search starts at character position specified by startIndex and examines a  number of character positions specified by count.

CutIfLong(maxLen)

Cuts a copy of this instance of MfString if it is longer than a given length and returns the result of the copy.

CutIfLong(maxLen, trailChars)

Cuts a copy of this instance of MfString if it is longer than a given length, replaces cut with the value of trailChars and returns the result of the copy

Difference(strFirst)

Gets the Difference between MfString instance and the strFirst argument

Difference(strFirst, maxDistance)

Gets the Difference between MfString instance and the strFirst argument with an included Max Distance.

Difference(strFirst, strSecond)

Gets the Difference between argument strFirst and argument strSecond

Difference(strFirst, strSecond, maxDistance)

Gets the Difference between argument strFirst and argument strSecond argument with an included Max Distance.

EndsWith(str)

Determines whether the end of MfString instance matches str. Case is Ignored

EndsWith(str, comparisonType)

Determines whether the end of MfString instance matches str and uses case rules set by comparisonType

Equals(strA)

Gets if an instance of MfString equals strA. Overrides MfObject.Equals()

Equals(strA, strB)

Gets if an strA equals strB

Escape()

Escapes current instance of MfString for use with AutoHotkey and returns a copy.

Escape(EscapeChar)

Escapes current instance of MfString for use with AutoHotkey and returns a copy.

EscapeSend()

Escape current instance of MfString for use with the send command and returns a copy.

Format(str, args*)

Formats a variable number of input values according to a format string.

FromCharList(chars [,startIndex, length])

Create a new instance of MfString from an instance of MfCharList.

GetEnumerator([AsCharCode])

Gets an enumerator that can enumerate through the string as chars or integer char codes.

GetHashCode()

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

GetType()

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

GetTypeCode()

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

GetValue(str)

Gets the string value as var from MfString object or var containing a String. Overrides MfPrimitive.GetValue()

IndexOf(searchChar)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within this instance.

IndexOf(searchChar, startIndex)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex.

IndexOf(searchChar, startIndex, count)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex and examines a  number of character positions specified by count.

IndexOf(strSearch)

Reports the zero-based index position of the first occurrence of a string specified by strSearch within this instance.

IndexOf(strSearch, startIndex)

Reports the zero-based index position of the first occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position.

IndexOf(strSearch, startIndex, count)

Reports the zero-based index position of the first occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

IndexOf(strMain, searchChar)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within strMain.

IndexOf(strMain, searchChar, startIndex)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position.

IndexOf(strMain, searchChar, startIndex, count)

Reports the zero-based index position of the first occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

IndexOf(strMain, strSearch)

Reports the zero-based index position of the first occurrence strSearch within strMain.

IndexOf(strMain, strSearch, startIndex)

Reports the zero-based index position of the first occurrence strSearch within this strMain. The search starts at character position specified by startIndex.

IndexOf(strMain, strSearch, startIndex, count)

Reports the zero-based index position of the first occurrence strSearch within this strMain. The search starts at character position specified by startIndex and examines a  number of character positions specified by count.

Is(type)

Gets if current instance of object is of the same type. Inherited from MfObject. Inherited from MfObject.

IsInstance()

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

IsNullOrEmpty(str)

Gets if MfString instance or var is null or empty

LastIndexOf(searchChar)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within this instance.

LastIndexOf(searchChar, startIndex)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex.

LastIndexOf(searchChar, startIndex, count)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within this instance. The search starts at a character position specified by startIndex and examines a  number of character positions specified by count.

LastIndexOf(strSearch)

Reports the zero-based index position of the last occurrence of a string specified by strSearch within this instance.

LastIndexOf(strSearch, startIndex)

Reports the zero-based index position of the last occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position.

LastIndexOf(strSearch, startIndex, count)

Reports the zero-based index position of the last occurrence of a string specified by strSearch within this instance. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

LastIndexOf(strMain, searchChar)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within strMain.

LastIndexOf(strMain, searchChar, startIndex)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position.

LastIndexOf(strMain, searchChar, startIndex, count)

Reports the zero-based index position of the last occurrence of a character specified by searchChar within strMain. The search starts at a character specified by startIndex position and examines a  number of character positions specified by count.

LastIndexOf(strMain, strSearch)

Reports the zero-based index position of the last occurrence strSearch within strMain.

LastIndexOf(strMain, strSearch, startIndex)

Reports the zero-based index position of the last occurrence strSearch within this strMain. The search starts at character position specified by startIndex.

LastIndexOf(strMain, strSearch, startIndex, count)

Reports the zero-based index position of the last occurrence strSearch within this strMain. The search starts at character position specified by startIndex and examines a  number of character positions specified by count.

MemberwiseClone()

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

PadLeft(totalWidth)

Returns a new MfString that right-aligns the characters in this instance of MfString by padding them with spaces on the left, for a specified total length.

PadLeft(totalWidth, paddingChar)

Returns a new MfString that right-aligns the characters in this instance of MfString by padding them on the left with a specified character, for a specified total length.

PadLeft(str, totalWidth)

Returns new MfString that right-aligns the characters in the str of MfString by padding them with spaces on the left, for a specified total length.

PadRight(totalWidth)

Returns a new MfString that left-aligns the characters in this instance of MfString by padding them with spaces on the right, for a specified total length.

PadRight(totalWidth, paddingChar)

Returns a new MfString that left-aligns the characters in this instance of MfString by padding them on the right with a specified character, for a specified total length.

PadRight(str, totalWidth)

Returns a new MfString that left-aligns the characters in the str of MfString by padding them with spaces on the right, for a specified total length.

PadRight(str, totalWidth, paddingChar)

Returns a new MfString that left-aligns the characters in the str of MfString by padding them on the right with a specified character, for a specified total length.

Remove(startIndex)

Returns a new MfString in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted.

Remove(startIndex, count)

Returns a new MfString with n characters removed from the zero-base startIndex forward, where n is count.

RemoveWhiteSpace(str [, ReturnAsObject])

Gets a string with all Unicode whitespace chars removed

Reverse()

Reverses the value of the MfString instance into a string.

Reverse(str)

Reverses the value of str into a string.

Split()

Splits the current string into all it characters.

Split(separator)

Splits the string into part by characters in separator.

Split(separator, options)

Splits the string into parts by characters with options.

StartsWith(str)

Determines whether the start of MfString instance matches str. Case is Ignored

StartsWith(str, comparisonType)

Determines whether the start of MfString instance matches str and uses case rules set by comparisonType

SubString(startIndex)

Retrieves a substring from this instance. The substring starts at a specified character position.

SubString(startIndex, length)

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

SubString(str, startIndex)

Retrieves a substring from the str. The substring starts at a specified character position.

SubString(str, startIndex, length)

Retrieves a substring from the str. The substring starts at a specified character position and has a specified length.

ToCharArray()

Copies the characters in a specified substring in this instance to a MfList of MfChar.

ToCharArray(startIndex)

Copies the characters in a specified substring in this instance to a MfList of MfChar starting at the positing of startIndex.

ToCharArray(startIndex, length)

Copies the characters in a specified substring in this instance to a MfList of MfChar starting at the positing of startIndex and stopping at length position.

ToCharList([startIndex, length])

Convert current instance of MfString to instance of MfCharList.

ToLower()

Gets a copy of the current Value and returns it converted to lower-case.

ToString()

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

ToTitle()

Gets a copy of the current Value and returns it converted to title-case.

ToUpper()

Gets a copy of the current Value and returns it converted to upper-case.

Trim()

Removes all leading and trailing white-space characters from the current MfString object.

Trim(trimChars)

Removes all leading and trailing occurrences of a set of characters specified in trimChars from the current MfString object.

TrimEnd()

Removes all trailing occurrences of white-space from the current MfString.

TrimEnd(trimChars)

Removes all trailing occurrences of a set of characters specified in trimchars from the current MfString.

TrimStart()

Removes all leading occurrences of white-space from the current MfString.

TrimStart(trimChars)

Removes all leading occurrences of a set of characters specified in trimchars from the current MfString.

UnEscape()

UnEscapes current instance of MfString that is encoded for AutoHotkey and returns a copy.

UnEscape(EscapeChar)

UnEscapes current instance of MfString that is encoded for AutoHotkey and returns a copy.

Related

StringBuilder

Example

mfsMsg := new MfString("What are your favorite pets names")
mfsMsg.AppendLine()
mfsMsg.Append("Separate names with commas")

UserInput := Mfunc.InputBox("Favorite pets", mfsMsg, , 450, 180)

if MfString.IsNullOrEmpty(UserInput)
{
   MsgBox, No Input was given
}
else
{
   try
   {
       strResult := new MfString(UserInput)
       col := strResult.Split(",", MfStringSplitOptions.Instance.RemoveEmptyEntries)
 
       MsgBox, 64, Value, % MfString.Format("You entered {0} Favorite Pets", col.Count)
       strList := new MfString()
       for i, pet in col
       {
           if (i < (col.Count -1))
           {
               strList.AppendLine(pet)
           }
           else
           {
               strList.Append(pet)
           }
       }
       MsgBox, 64, List, % strList.Value
   }
   catch
   {
       MsgBox, 16, Bad Input, The input was not acceptable.
   }
}