strcmp, stricmp

Gamma: Version 4.0
Prev |  | Next

# `strcmp`, `stricmp`

`strcmp`, `stricmp` -- compare strings.

## Syntax

    strcmp (string, string)
    stricmp (string, string)

## Arguments

`string`

  Any string.

## Returns

A negative number if the first `string` is ordinally less than the second `string` according to the ASCII character set, a positive number if the first `string` is greater than the second, and zero if the two strings are exactly equal.

## Description

These functions can be used as comparison functions for `sort` and `insert`. `stricmp` performs the same function as `strcmp`, but alphabetic characters are compared without regard to case. That is, "A" and "a" are considered equal by `stricmp`, but different by `strcmp`.

## Example

        Gamma> strcmp("apple", "peach");
        -15
        Gamma> strcmp("peach", "apple");
        15
        Gamma> strcmp("Apple","Apple");
        0
        Gamma> strcmp("Apple","Apple pie");
        -32
        Gamma> strcmp("Apple","apple");
        -32
        Gamma> stricmp("Apple","apple");
        0
        Gamma>

## See Also

`insert`, `sort`, `strchr`, `strrchr`

Prev | Home | Next
`strchr`, `strrchr` | Up | `string`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.