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

1

6

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?

Llewellyn answered 4/3, 2017 at 2:48 Comment(0)
H
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
Hurrah answered 4/3, 2017 at 3:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.