1 <refentry id="refshave"> 2 3 <refmeta> 4 <refentrytitle>ne_shave</refentrytitle> 5 <manvolnum>3</manvolnum> 6 </refmeta> 7 8 <refnamediv> 9 <refname>ne_shave</refname> 10 <refpurpose>trim whitespace from a string</refpurpose> 11 </refnamediv> 12 13 <refsynopsisdiv> 14 15 <funcsynopsis> 16 17 <funcsynopsisinfo>#include <ne_string.h></funcsynopsisinfo> 18 19 <funcprototype> 20 <funcdef>char *<function>ne_shave</function></funcdef> 21 <paramdef>char *<parameter>str</parameter></paramdef> 22 <paramdef>const char *<parameter>whitespace</parameter></paramdef> 23 </funcprototype> 24 25 </funcsynopsis> 26 27 </refsynopsisdiv> 28 29 <refsect1> 30 <title>Description</title> 31 32 <para><function>ne_shave</function> returns a portion of 33<parameter>str</parameter> with any leading or trailing characters in 34the <parameter>whitespace</parameter> array removed. 35<parameter>str</parameter> may be modified. Note that the return 36value may not be equal to <parameter>str</parameter>.</para> 37 38 </refsect1> 39 40 <refsect1> 41 <title>Examples</title> 42 43 <para>The following code segment will output 44 <literal>"fish"</literal>:</para> 45 46 <programlisting>char s[] = ".!.fish!.!"; 47puts(ne_shave(s, ".!"));</programlisting> 48 49 </refsect1> 50 51 </refentry> 52 53