System.SysUtils.TStringHelper.Equals

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Equals(const Value: string): Boolean; overload;
class function Equals(const a: string; const b: string): Boolean; overload; static;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Returns whether the two given strings are identical.

Equals is a function that returns whether two strings are identical. There are two Equals overloaded methods:

  • The first one returns whether this string is equal to the string passed through the Value parameter.
  • The second overloaded method is a static class function that can be called to check for equality between the two passed strings.
var
  MyString1: String;
  MyString2: String;

begin
  MyString1 := 'This is one string.';
  MyString2 := 'This is another string.';
  Writeln(Boolean(MyString1.Equals(MyString2)));
  Writeln(Boolean(String.Equals(MyString1, MyString2)));
end.

Output:

FALSE
FALSE

See Also