Common string manipulation functions linuxC

strlen - Returns the length of the string, such as char * p = "hello"; strlen (p) returns the length. 5 
strcmp - string comparison functions, less than or greater, respectively, return 1,0, -1
a strncmp - String Comparison function, a plurality of parameters n, represents a plurality of characters up to compare
strcasecmp - case-insensitive comparison function

strstr - string interception function, is taken back abbreviation str. For example strstr ( "hello = world", "=") returns the string "World ="
strcpy - string copy function, generally taken for a string. For example char * p = "hello = world "; char dest [512]; Results strcpy (dest, p + 6,5) is dest is "world"


 

Guess you like

Origin www.cnblogs.com/yongfengnice/p/11817059.html