Explorar o código

HPCC-7872 add 3 Std.Str funcs: ExcludeFirstWord ExcludeLastWord ExcludeNthWord

Signed-off-by: Richard Taylor <richard.taylor@lexisnexis.com>
Richard Taylor %!s(int64=12) %!d(string=hai) anos
pai
achega
f96f4a65c3

+ 48 - 0
docs/ECLStandardLibraryReference/SLR-Mods/ExcludeFirstWord.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="ExcludeLastWord">
+  <title>ExcludeLastWord</title>
+
+  <para><emphasis role="bold">STD.Str.ExcludeLastWord<indexterm>
+      <primary>STD.Str.ExcludeLastWord</primary>
+    </indexterm><indexterm>
+      <primary>Str.ExcludeLastWord</primary>
+    </indexterm><indexterm>
+      <primary>ExcludeLastWord</primary>
+    </indexterm>(</emphasis> <emphasis>text</emphasis> <emphasis
+  role="bold">)</emphasis></para>
+
+  <informaltable colsep="0" frame="none" rowsep="0">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>text</emphasis></entry>
+
+          <entry>A string containing words separated by whitespace. </entry>
+        </row>
+
+        <row>
+          <entry>Return:<emphasis> </emphasis></entry>
+
+          <entry>ExcludeLastWord returns a STRING value.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para>The <emphasis role="bold">ExcludeLastWord </emphasis>function returns
+  the <emphasis>text</emphasis> string with the last word removed. Words are
+  separated by one or more whitespace characters. Whitespace before and after
+  the first word is also removed.</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">A := STD.Str.ExcludeLastWord('The quick brown fox');
+ //A contains 'The quick brown'
+</programlisting>
+</sect1>

+ 54 - 0
docs/ECLStandardLibraryReference/SLR-Mods/ExcludeLastWord.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="ExcludeNthWord">
+  <title>ExcludeNthWord</title>
+
+  <para><emphasis role="bold">STD.Str.ExcludeNthWord<indexterm>
+      <primary>STD.Str.ExcludeNthWord</primary>
+    </indexterm><indexterm>
+      <primary>Str.ExcludeNthWord</primary>
+    </indexterm><indexterm>
+      <primary>ExcludeNthWord</primary>
+    </indexterm>(</emphasis> <emphasis>text, n</emphasis> <emphasis
+  role="bold">)</emphasis></para>
+
+  <informaltable colsep="0" frame="none" rowsep="0">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>text</emphasis></entry>
+
+          <entry>A string containing words separated by whitespace.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>n</emphasis></entry>
+
+          <entry>A integer containing the ordinal position of the word to remove.</entry>
+        </row>
+
+        <row>
+          <entry>Return:<emphasis> </emphasis></entry>
+
+          <entry>ExcludeNthWord returns a STRING value.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para>The <emphasis role="bold">ExcludeNthWord </emphasis>function returns
+  the <emphasis>text</emphasis> string with the <emphasis>n</emphasis>th word removed. Words are
+  separated by one or more whitespace characters. Whitespace after
+  the <emphasis>n</emphasis>th word is also removed (along with whitespace before, if <emphasis>n</emphasis>=1).</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">A := STD.Str.ExcludeNthWord('The quick brown fox',2);
+ //A contains 'The brown fox'
+</programlisting>
+</sect1>

+ 56 - 0
docs/ECLStandardLibraryReference/SLR-Mods/ExcludeNthWord.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<sect1 id="ExcludeNthWord">
+  <title>ExcludeNthWord</title>
+
+  <para><emphasis role="bold">STD.Str.ExcludeNthWord<indexterm>
+      <primary>STD.Str.ExcludeNthWord</primary>
+    </indexterm><indexterm>
+      <primary>Str.ExcludeNthWord</primary>
+    </indexterm><indexterm>
+      <primary>ExcludeNthWord</primary>
+    </indexterm>(</emphasis> <emphasis>text, n</emphasis> <emphasis
+  role="bold">)</emphasis></para>
+
+  <informaltable colsep="0" frame="none" rowsep="0">
+    <tgroup cols="2">
+      <colspec colwidth="80.50pt" />
+
+      <colspec />
+
+      <tbody>
+        <row>
+          <entry><emphasis>text</emphasis></entry>
+
+          <entry>A string containing words separated by whitespace.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>n</emphasis></entry>
+
+          <entry>A integer containing the ordinal position of the word to
+          remove.</entry>
+        </row>
+
+        <row>
+          <entry>Return:<emphasis> </emphasis></entry>
+
+          <entry>ExcludeNthWord returns a STRING value.</entry>
+        </row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <para>The <emphasis role="bold">ExcludeNthWord </emphasis>function returns
+  the <emphasis>text</emphasis> string with the <emphasis>n</emphasis>th word
+  removed. Words are separated by one or more whitespace characters.
+  Whitespace after the <emphasis>n</emphasis>th word is also removed (along
+  with whitespace before, if <emphasis>n</emphasis>=1).</para>
+
+  <para>Example:</para>
+
+  <programlisting format="linespecific">A := STD.Str.ExcludeNthWord('The quick brown fox',2);
+ //A contains 'The brown fox'
+</programlisting>
+</sect1>

+ 4 - 0
docs/ECLStandardLibraryReference/SLR-includer.xml

@@ -254,6 +254,10 @@
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/EqualIgnoreCase.xml"
                 xmlns:xi="http://www.w3.org/2001/XInclude" />
 
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/ExcludeFirstWord.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/ExcludeLastWord.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="ECLStandardLibraryReference/SLR-Mods/ExcludeNthWord.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/Extract.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
 
     <xi:include href="ECLStandardLibraryReference/SLR-Mods/Filter.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />