# STRTRAN()

Translate substring valuw with a main string

Syntax

  STRTRAN( <cString>, <cLocString>, [<cRepString>], [<nPos>],
  [<nOccurences>] ) --> cReturn

Arguments

  <cString> The main string to search
  <cLocString> The string to locate in the main string
  <cRepString> The string to replace the <cLocString>
  <nPos> The first occurence to be replaced
  <nOccurences> Number of occurence to replace

Returns

  <cReturn> Formated string

Description

  This function searches for any occurence of <cLocString> in <cString> and replacesit with <cRepString>.If <cRepString> is not specified, a NULL byte will replace <cLocString>.
  If <nPos> is used,its value defines the first occurence to be replaced.The default value is 1.Additionally,if used,the value of <nOccurences> tell the function how many occurrences of <cLocString> in <cString> are to the replaced.The default of <nOccurences> is all occurrences.

Examples

          ? STRTRAN( "Harbour  Power", "  ", " " )   // Harbour Power
                   // Harbour Power The future  of  xBase
          ? STRTRAN( "Harbour  Power  The Future  of  xBase", "  ", " " ,, 2 )
    Tests
          See regression test

Status

  Ready

Compliance

  Will not work with a search string of > 64 KB on some platforms

Platforms

  All

Files

  Libraty is rtl

See Also

- SUBSTR()
- AT()