Npgsql Api Docs |

# BitString.CompareTo Method

Compares two strings. Strings are compared as strings, so while 0 being less than 1 will mean a comparison between two strings of the same size is the same as treating them as numbers, in the case of two strings of differing lengths the comparison starts at the right-most (most significant) bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100).

#### Overload List

Compares two strings. Strings are compared as strings, so while 0 being less than 1 will mean a comparison between two strings of the same size is the same as treating them as numbers, in the case of two strings of differing lengths the comparison starts at the right-most (most significant) bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100).

> public int CompareTo(BitString);

Compares the string with another object.

> public int CompareTo(object);

#### See Also

BitString Class | NpgsqlTypes Namespace