Skip to main content

Compare Method

Compares two strings.

Definition​

Namespace: GHost.GSharp.PI.ACE
Assembly: GHost.GSharp.PI.ACE (in GHost.GSharp.PI.ACE.dll) Version: 1.2.44.3 (1.2.44.3)

C#

public static bool Compare(
string string1,
string string2,
bool isCaseSensitive = false
)

VB

Public Shared Function Compare ( 
string1 As String,
string2 As String,
Optional isCaseSensitive As Boolean = false
) As Boolean

Parameters​

  String
First input string.
  String
Second input string. "*" and "?" in the second string are treated as wild characters.
  Boolean  (Optional)
[Optional] Boolean flag indicating if the comparison is case sensitive.

Return Value​

Boolean
True if the input strings are the same and False if otherwise.

Example​

Compare("?","a") returns False

Compare("What","wh") returns False

Compare("What","wha?") returns True

Compare("What","wh*") returns True

Compare("What","wh*", 1) returns False

Exceptions​

ArgumentException
ArgumentNullException
RegexMatchTimeoutException

See Also​

Reference​

PIACEBIFunctions Class
GHost.GSharp.PI.ACE Namespace