---
name: "CompareStringA"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CompareStringA"
---

# CompareStringA(3w)

## NAME

**CompareStringA** (KERNEL32.@)

## SYNOPSIS

INT CompareStringA\
  (\
   LCID   *lcid*,\
   DWORD  *style*,\
   LPCSTR *str1*,\
   INT    *len1*,\
   LPCSTR *str2*,\
   INT    *len2*\
  )

## DESCRIPTION

Compare two locale sensitive strings.

## PARAMS

*lcid* **\[In\]**  **LCID** for the comparison.

*style* **\[In\]**  Flags for the comparison (**NORM\_** constants from **"winnls.h"**).

*str1* **\[In\]**  First string to compare.

*len1* **\[In\]**  Length of *str1*, or **-1** if *str1* is **NUL** terminated.

*str2* **\[In\]**  Second string to compare.

*len2* **\[In\]**  Length of *str2*, or **-1** if *str2* is **NUL** terminated.

## RETURNS

**Success:** **CSTR\_LESS\_THAN**, **CSTR\_EQUAL** or **CSTR\_GREATER\_THAN** depending on whether *str1* is less than, equal to or greater than *str2* respectively.

**Failure:** **FALSE**. Use **[GetLastError(3w)](/GetLastError/3w.md)** to determine the cause.

## IMPLEMENTATION

Declared in **"winnls.h"**.

Implemented in **"dlls/kernel32/locale.c"**.

Debug channel **"nls"**.
