Standard Library String Functions in C

List of all Standard Library String Functions

FunctionUse
strlenFinds length of a string
strlwrConverts a string to lowercase
struprConverts a string to uppercase
strcatAppends one string at the end of another
strncatAppends first n characters of a string at the end of
another
strcpyCopies a string into another
strncpyCopies first n characters of one string into another
strcmpCompares two strings
strncmpCompares first n characters of two strings
strcmpiCompares two strings without regard to case (“i” denotes
that this function ignores case)
stricmpCompares two strings without regard to case (identical to
strcmpi)
strnicmpCompares first n characters of two strings without regard
to case
strdupDuplicates a string
strchrFinds first occurrence of a given character in a string
strrchrFinds last occurrence of a given character in a string
strstrFinds first occurrence of a given string in another string
strsetSets all characters of string to a given character
strnsetSets first n characters of a string to a given character
strrevReverses string
List of all Standard Library String Functions

Leave a Comment