SplitWords.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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="SplitWords">
  5. <title>SplitWords</title>
  6. <para><emphasis role="bold">STD.Str.SplitWords<indexterm>
  7. <primary>STD.Str.SplitWords</primary>
  8. </indexterm><indexterm>
  9. <primary>Str.SplitWords</primary>
  10. </indexterm>(</emphasis> <emphasis>source, separator </emphasis><emphasis
  11. role="bold">)</emphasis></para>
  12. <informaltable colsep="0" frame="none" rowsep="0">
  13. <tgroup cols="2">
  14. <colspec colwidth="80.50pt" />
  15. <colspec />
  16. <tbody>
  17. <row>
  18. <entry><emphasis>source</emphasis></entry>
  19. <entry>A string containing the words to extract.</entry>
  20. </row>
  21. <row>
  22. <entry><emphasis>separator</emphasis></entry>
  23. <entry>A string containing the word delimiter to use.</entry>
  24. </row>
  25. <row>
  26. <entry>Return:</entry>
  27. <entry>SplitWords returns a SET OF STRING values.</entry>
  28. </row>
  29. </tbody>
  30. </tgroup>
  31. </informaltable>
  32. <para>The <emphasis role="bold">SplitWords</emphasis> function returns the
  33. list of words in the <emphasis>source</emphasis> string split out by the
  34. specified <emphasis>separator</emphasis>.</para>
  35. <para>Example:</para>
  36. <programlisting format="linespecific">IMPORT Std;
  37. str1 := 'a word a day keeps the doctor away';
  38. str2 := 'a|word|a|day|keeps|the|doctor|away';
  39. STD.STr.SplitWords(str1,' ');
  40. //returns ['a', 'word', 'a', 'day', 'keeps', 'the', 'doctor', 'away']
  41. STD.STr.SplitWords(str2,'|');
  42. //returns ['a', 'word', 'a', 'day', 'keeps', 'the', 'doctor', 'away']
  43. </programlisting>
  44. <para></para>
  45. </sect1>