WordCount.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="WordCount">
  5. <title>WordCount</title>
  6. <para><emphasis role="bold">STD.Str.WordCount<indexterm>
  7. <primary>STD.Str.WordCount</primary>
  8. </indexterm><indexterm>
  9. <primary>Str.WordCount</primary>
  10. </indexterm>(</emphasis> <emphasis>source</emphasis><emphasis role="bold">
  11. )</emphasis></para>
  12. <para><emphasis role="bold">STD.Uni.WordCount<indexterm>
  13. <primary>STD.Uni.WordCount</primary>
  14. </indexterm><indexterm>
  15. <primary>Uni.WordCount</primary>
  16. </indexterm>(</emphasis> <emphasis>source </emphasis><emphasis
  17. role="bold">[</emphasis><emphasis>, locale </emphasis><emphasis role="bold">
  18. ] )</emphasis></para>
  19. <informaltable colsep="1" frame="all" rowsep="1">
  20. <tgroup cols="2">
  21. <colspec colwidth="80.50pt" />
  22. <colspec />
  23. <tbody>
  24. <row>
  25. <entry><emphasis>source</emphasis></entry>
  26. <entry>A string containing the words to count. Words are delimited
  27. by spaces.</entry>
  28. </row>
  29. <row>
  30. <entry><emphasis>locale</emphasis></entry>
  31. <entry>A null-terminated string containing the language and country
  32. code to use to determine correct sort order and other
  33. operations.</entry>
  34. </row>
  35. <row>
  36. <entry>Return:</entry>
  37. <entry>WordCount returns an integer value.</entry>
  38. </row>
  39. </tbody>
  40. </tgroup>
  41. </informaltable>
  42. <para>The <emphasis role="bold">WordCount </emphasis>function returns the
  43. number of words in the <emphasis>source</emphasis> string.</para>
  44. <para>Example:</para>
  45. <programlisting format="linespecific">IMPORT Std;
  46. str1 := 'a word a day keeps the doctor away';
  47. output(LENGTH(TRIM(Str1,LEFT,RIGHT)) - LENGTH(TRIM(Str1,ALL)) + 1);
  48. //finds eight words by removing spaces
  49. STD.Str.WordCount(str1); //finds eight words based on space delimiter
  50. </programlisting>
  51. <para></para>
  52. </sect1>