---
name: "strxfrm"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/strxfrm"
---

# strxfrm(3)

string transform

## NAME

strxfrm - string transform

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <string.h>
```

**size\_t strxfrm(**size\_t size;                **char** *dest***\[restrict** *size***\], const char** *src***\[restrict** *size***\],**                **size\_t** *size***);**

## DESCRIPTION

The **strxfrm**() function transforms the *src* string into a form such that the result of [**strcmp**(3)](/strcmp/3.md) on two strings that have been transformed with **strxfrm**() is the same as the result of [**strcoll**(3)](/strcoll/3.md) on the two strings before their transformation. The first *size* bytes of the transformed string are placed in *dest*. The transformation is based on the program's current locale for category **LC\_COLLATE**. (See [**setlocale**(3)](/setlocale/3.md)).

## RETURN VALUE

The **strxfrm**() function returns the number of bytes required to store the transformed string in *dest* excluding the terminating null byte ('\\0'). If the value returned is *size* or more, the contents of *dest* are indeterminate.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **strxfrm**() | Thread safety | MT-Safe locale |

## STANDARDS

C11, POSIX.1-2008.

## HISTORY

POSIX.1-2001, C89, SVr4, 4.3BSD.

## SEE ALSO

[**setlocale**(3)](/setlocale/3.md), [**strcmp**(3)](/strcmp/3.md), [**strcoll**(3)](/strcoll/3.md), [**string**(3)](/string/3.md)
