CARM User's Guide

Discontinued

String Routines

RoutineAttributesDescription
strcat Concatenates two strings.
strchrreentrantReturns a pointer to the first occurrence of a specified character in a string.
strcmpreentrantCompares two strings.
strcpyreentrantCopies one string to another.
strcspn Returns the index of the first character in a string that matches any character in a second string.
strlenreentrantReturns the length of a string.
strncat Concatenates up to a specified number of characters from one string to another.
strncmp Compares two strings up to a specified number of characters.
strncpy Copies up to a specified number of characters from one string to another.
strpbrk Returns a pointer to the first character in a string that matches any character in a second string.
strposreentrantReturns the index of the first occurrence of a specified character in a string.
strrchrreentrantReturns a pointer to the last occurrence of a specified character in a string.
strrpbrk Returns a pointer to the last character in a string that matches any character in a second string.
strrposreentrantReturns the index of the last occurrence of a specified character in a string.
strspn Returns the index of the first character in a string that does not match any character in a second string.

The string routines are implemented as functions and are prototyped in the string.h include file. They perform the following operations:

  • Copying strings
  • Appending one string to the end of another
  • Comparing two strings
  • Locating one or more characters from a specified set in a string

All string functions operate on null-terminated character strings. Use the buffer manipulation routines to work on non-terminated strings.