shave.xml 1.2 KB

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