[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'sysutils' (#rtl)

# TStringHelper.CompareTo

Compare string to another

## Declaration

Source position: syshelph.inc line 100

`public function TStringHelper.CompareTo(`
`const B: string`
`):Integer;`

## Description

CompareTo will compare the string value to the string B. It returns the following result:

- 0 if the strings are equal
- a negative number if Self < B
- a positive number if Self > B

The StrComp function is used for this.

## See also

TStringHelper.Compare |  | Compare 2 strings
TStringHelper.CompareOrdinal |  | Compare 2 strings byte for byte
StrComp |  | Compare 2 null-terminated strings, case sensitive.