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 lengthstrcpy
string copystrcmp
string compareSome 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?
strlen
- find LENgth of stringstrcpy
- CoPY stringsstrcmp
- CoMPare stringsstrrchr
- Reversely find CHaRacterstrspn
- calculate the length of SPaN of charactersstrxfrm
- TRANS (written as X)-FoRM a stringstrpbrk
- find the Point where string is BRoKen by any of the characters