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,860
  • 7
  • 40
  • 71

1 Answers1

4
  • 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,860
  • 7
  • 40
  • 71
DYZ
  • 55,249
  • 10
  • 64
  • 93