SRep$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (moved SRep$ to SREP$)
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
SRep$(A$[,X],B$,C$)
  SREP$(<A$>[,<X>],<B$>,<C$>)


The '''SRep$''' [[internal function]] or '''string replace''' returns A$ with changes. Each substring in A$, from position X on, that matches B$, is replaced by C$. If X is omitted, the search for the match begins at the first character of A$.
The '''SRep$''' [[internal function]] or '''string replace''' returns A$ with changes. Each substring in A$, from position X on, that matches B$, is replaced by C$. If X is omitted, the search for the match begins at the first character of A$.

Latest revision as of 03:13, 22 May 2014

 SREP$(<A$>[,<X>],<B$>,<C$>)

The SRep$ internal function or string replace returns A$ with changes. Each substring in A$, from position X on, that matches B$, is replaced by C$. If X is omitted, the search for the match begins at the first character of A$.

Comments and Examples

00010 let A$="Wow, that fish was that big."
00020 let B$="that"
00030 let C$="this"
00040 print SRep$(A$,B$,C$)
00050 print SRep$(A$,7,B$,C$)

The above program will print:

Wow, this fish was this big.
Wow, that fish was this big.

Related Functions