5

The C standard library string.h contains several functions to manipulate strings, all of which start with str and end with an abbreviation. Some of these abbreviations are obvious:

  • strlen string length
  • strcpy string copy
  • strcmp string compare

Some are a bit less straightforward:

  • strpbrk string pointer break?
  • strspn string ...spn?
  • strrchr string ... R char??
  • strxfrm string... um... nevermind.

What do each of the str-function abbreviations/acronyms mean?

MD XF
  • 7,062
  • 7
  • 34
  • 64

1 Answers1

3
  • strlen - find LENgth of string
  • strcpy - CoPY strings
  • strcmp - CoMPare strings
  • strrchr - Reversely find CHaRacter
  • strspn - calculate the length of SPaN of characters
  • strxfrm - TRANS (written as X)-FoRM a string
  • strpbrk - find the Point where string is BRoKen by any of the characters
MD XF
  • 7,062
  • 7
  • 34
  • 64
DYZ
  • 45,526
  • 9
  • 47
  • 76