diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-10-28 23:17:03 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-10-28 23:17:03 +0000 |
commit | 005ce523f141e9f0b5c1578830d0595af1b4320e (patch) | |
tree | dc24c2520a1065eae451cdb4da7dfd5a571bc2e6 /doc/mailfromd.texi | |
parent | d3f4d2788e7b5df1df32d642ed4aa0df8f65a5c7 (diff) | |
download | mailfromd-005ce523f141e9f0b5c1578830d0595af1b4320e.tar.gz mailfromd-005ce523f141e9f0b5c1578830d0595af1b4320e.tar.bz2 |
Improve string functions.
* mfd/bi_string.m4 (index, rindex): Take an optional third
argument, indicating where to start searching.
* NEWS, doc/mailfromd.texi: Document changes to index and rindex.
git-svn-id: file:///svnroot/mailfromd/trunk@1707 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r-- | doc/mailfromd.texi | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 53039974..058e53ef 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -5634,7 +5634,8 @@ domainpart "gray@@gnu.org.ua" @result{} "gnu.org.ua" @anchor{index-built-in} @deftypefn {Built-in Function} number index (string @var{s}, string @var{t}) - +@deftypefnx {Built-in Function} number index (string @var{s}, string @var{t}, @ + number @var{start}) Returns the index of the first occurrence of the string @var{t} in the string @var{s}, or -1 if @var{t} is not present. @@ -5642,6 +5643,13 @@ the string @var{s}, or -1 if @var{t} is not present. index("string of rings", "ring") @result{} 2 @end smallexample + Optional argument @var{start}, if supplied, indicates the position +in string where to start searching. + +@smallexample +index("string of rings", "ring", 3) @result{} 10 +@end smallexample + To find the last occurrence of a substring, use the function @var{rindex} (@pxref{rindex}). @end deftypefn @@ -5684,6 +5692,8 @@ revstr("foobar") @result{} "raboof" @anchor{rindex} @deftypefn {Built-in Function} number rindex (string @var{s}, string @var{t}) +@deftypefnx {Built-in Function} number rindex (string @var{s}, string @var{t}, @ + number @var{start}) Returns the index of the last occurrence of the string @var{t} in the string @var{s}, or -1 if @var{t} is not present. @@ -5692,6 +5702,13 @@ the string @var{s}, or -1 if @var{t} is not present. rindex("string of rings", "ring") @result{} 10 @end smallexample + Optional argument @var{start}, if supplied, indicates the position +in string where to start searching. E.g.: + +@smallexample +rindex("string of rings", "ring", 10) @result{} 2 +@end smallexample + See also @ref{index-built-in, @code{index} built-in function, String manipulation}. @end deftypefn |