1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>String Manipulation</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="libc.html" title="Chapter 2. Basic C Library Functions"><link rel="prev" href="API-kstrtoint.html" title="kstrtoint"><link rel="next" href="API-strncasecmp.html" title="strncasecmp"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">String Manipulation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-kstrtoint.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Basic C Library Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-strncasecmp.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1122795604"></a>String Manipulation</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-strncasecmp.html"><span class="phrase">strncasecmp</span></a></span><span class="refpurpose"> — 2 Case insensitive, length-limited string comparison 3 </span></dt><dt><span class="refentrytitle"><a href="API-strcpy.html"><span class="phrase">strcpy</span></a></span><span class="refpurpose"> — 4 Copy a <code class="constant">NUL</code> terminated string 5 </span></dt><dt><span class="refentrytitle"><a href="API-strncpy.html"><span class="phrase">strncpy</span></a></span><span class="refpurpose"> — 6 Copy a length-limited, C-string 7 </span></dt><dt><span class="refentrytitle"><a href="API-strlcpy.html"><span class="phrase">strlcpy</span></a></span><span class="refpurpose"> — 8 Copy a C-string into a sized buffer 9 </span></dt><dt><span class="refentrytitle"><a href="API-strcat.html"><span class="phrase">strcat</span></a></span><span class="refpurpose"> — 10 Append one <code class="constant">NUL-terminated</code> string to another 11 </span></dt><dt><span class="refentrytitle"><a href="API-strncat.html"><span class="phrase">strncat</span></a></span><span class="refpurpose"> — 12 Append a length-limited, C-string to another 13 </span></dt><dt><span class="refentrytitle"><a href="API-strlcat.html"><span class="phrase">strlcat</span></a></span><span class="refpurpose"> — 14 Append a length-limited, C-string to another 15 </span></dt><dt><span class="refentrytitle"><a href="API-strcmp.html"><span class="phrase">strcmp</span></a></span><span class="refpurpose"> — 16 Compare two strings 17 </span></dt><dt><span class="refentrytitle"><a href="API-strncmp.html"><span class="phrase">strncmp</span></a></span><span class="refpurpose"> — 18 Compare two length-limited strings 19 </span></dt><dt><span class="refentrytitle"><a href="API-strchr.html"><span class="phrase">strchr</span></a></span><span class="refpurpose"> — 20 Find the first occurrence of a character in a string 21 </span></dt><dt><span class="refentrytitle"><a href="API-strchrnul.html"><span class="phrase">strchrnul</span></a></span><span class="refpurpose"> — 22 Find and return a character in a string, or end of string 23 </span></dt><dt><span class="refentrytitle"><a href="API-strrchr.html"><span class="phrase">strrchr</span></a></span><span class="refpurpose"> — 24 Find the last occurrence of a character in a string 25 </span></dt><dt><span class="refentrytitle"><a href="API-strnchr.html"><span class="phrase">strnchr</span></a></span><span class="refpurpose"> — 26 Find a character in a length limited string 27 </span></dt><dt><span class="refentrytitle"><a href="API-skip-spaces.html"><span class="phrase">skip_spaces</span></a></span><span class="refpurpose"> — 28 Removes leading whitespace from <em class="parameter"><code>str</code></em>. 29 </span></dt><dt><span class="refentrytitle"><a href="API-strim.html"><span class="phrase">strim</span></a></span><span class="refpurpose"> — 30 Removes leading and trailing whitespace from <em class="parameter"><code>s</code></em>. 31 </span></dt><dt><span class="refentrytitle"><a href="API-strlen.html"><span class="phrase">strlen</span></a></span><span class="refpurpose"> — 32 Find the length of a string 33 </span></dt><dt><span class="refentrytitle"><a href="API-strnlen.html"><span class="phrase">strnlen</span></a></span><span class="refpurpose"> — 34 Find the length of a length-limited string 35 </span></dt><dt><span class="refentrytitle"><a href="API-strspn.html"><span class="phrase">strspn</span></a></span><span class="refpurpose"> — 36 Calculate the length of the initial substring of <em class="parameter"><code>s</code></em> which only contain letters in <em class="parameter"><code>accept</code></em> 37 </span></dt><dt><span class="refentrytitle"><a href="API-strcspn.html"><span class="phrase">strcspn</span></a></span><span class="refpurpose"> — 38 Calculate the length of the initial substring of <em class="parameter"><code>s</code></em> which does not contain letters in <em class="parameter"><code>reject</code></em> 39 </span></dt><dt><span class="refentrytitle"><a href="API-strpbrk.html"><span class="phrase">strpbrk</span></a></span><span class="refpurpose"> — 40 Find the first occurrence of a set of characters 41 </span></dt><dt><span class="refentrytitle"><a href="API-strsep.html"><span class="phrase">strsep</span></a></span><span class="refpurpose"> — 42 Split a string into tokens 43 </span></dt><dt><span class="refentrytitle"><a href="API-sysfs-streq.html"><span class="phrase">sysfs_streq</span></a></span><span class="refpurpose"> — 44 return true if strings are equal, modulo trailing newline 45 </span></dt><dt><span class="refentrytitle"><a href="API-strtobool.html"><span class="phrase">strtobool</span></a></span><span class="refpurpose"> — 46 convert common user inputs into boolean values 47 </span></dt><dt><span class="refentrytitle"><a href="API-memset.html"><span class="phrase">memset</span></a></span><span class="refpurpose"> — 48 Fill a region of memory with the given value 49 </span></dt><dt><span class="refentrytitle"><a href="API-memzero-explicit.html"><span class="phrase">memzero_explicit</span></a></span><span class="refpurpose"> — 50 Fill a region of memory (e.g. sensitive keying data) with 0s. 51 </span></dt><dt><span class="refentrytitle"><a href="API-memcpy.html"><span class="phrase">memcpy</span></a></span><span class="refpurpose"> — 52 Copy one area of memory to another 53 </span></dt><dt><span class="refentrytitle"><a href="API-memmove.html"><span class="phrase">memmove</span></a></span><span class="refpurpose"> — 54 Copy one area of memory to another 55 </span></dt><dt><span class="refentrytitle"><a href="API-memcmp.html"><span class="phrase">memcmp</span></a></span><span class="refpurpose"> — 56 Compare two areas of memory 57 </span></dt><dt><span class="refentrytitle"><a href="API-memscan.html"><span class="phrase">memscan</span></a></span><span class="refpurpose"> — 58 Find a character in an area of memory. 59 </span></dt><dt><span class="refentrytitle"><a href="API-strstr.html"><span class="phrase">strstr</span></a></span><span class="refpurpose"> — 60 Find the first substring in a <code class="constant">NUL</code> terminated string 61 </span></dt><dt><span class="refentrytitle"><a href="API-strnstr.html"><span class="phrase">strnstr</span></a></span><span class="refpurpose"> — 62 Find the first substring in a length-limited string 63 </span></dt><dt><span class="refentrytitle"><a href="API-memchr.html"><span class="phrase">memchr</span></a></span><span class="refpurpose"> — 64 Find a character in an area of memory. 65 </span></dt><dt><span class="refentrytitle"><a href="API-memchr-inv.html"><span class="phrase">memchr_inv</span></a></span><span class="refpurpose"> — 66 Find an unmatching character in an area of memory. 67 </span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-kstrtoint.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="libc.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-strncasecmp.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">kstrtoint</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">strncasecmp</span></td></tr></table></div></body></html> 68