strxfrm

Transforms a specified number of characters from one string to another string

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:String Manipulation

Syntax

  #include <string.h>  
   
  size_t strxfrm  (  
     char         *dst,   
     const char   *src,   
     size_t        n);
  

Parameters

dst
(OUT) Points to the array into which to place the transformed characters.
src
(IN) Points to the string to be transformed.
n
(IN) Specifies the number of characters to transform.

Return Values

The strxfrm function returns the length of the transformed string. If this length is more than n, the contents of the array pointed to by dst are indeterminate.

Remarks

The strxfrm function transforms, for no more than n characters, the string pointed to by src to the buffer pointed to by dst. The transformation uses the collating sequence selected by setlocale to normalize the string. If successful, the transformed string is null terminated.

The strcoll function normalizes two strings and then returns whether the strings are equal. It does not return the normalized strings. The strxfrm function allows you to normalize a string and access the results. If you pass the original string and the same string normalized with strxfrm to strcoll, strcoll would declare them equal.

To determine how much room is needed to store the results of the strxfrm function, set dst to NULL and n to 0 and call the function with src specifying the string to convert.

See Also

setlocale (Internationalization), strcoll