Harbour Reference Guide

 

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
      ? StrTran("Harbour  Power  The Future  of  xBase","  "," ",,2) // Harbour Power The future  of  xBase
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

 




[Source Forge]

Other Docs Categories

Advantage Database RDD
Array
Binary conversion
Classes
Code Block
Console input
Conversion
Conversion Tools
DOS
Data input and output
Database
Database Tools
Date
Dos Tools
Environment
Error recovery
Events
File management
GT
Harbour Tools
Internal
Low Level
Math
Misc
Miscellaneous
Nation
Object manipulation
Operating System Specific
Parameter Checks
String Tools
Strings
TBrowse Method
TBrowse class
Terminal
Time
Utility
Variable Management

 

Last updated on 2001/07/30