Project

General

Profile

Actions

$reptokcs » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
Per Amundsen, 11/26/2015 06:17 PM


Added in 1.9.0

$reptokcs(text,token,new,[N],C)

Replaces the Nth matching token in text with a new token.

$reptokcs is case-sensitive, see $reptok for case-insensitive version.

Parameters

text - The text to tokenize.
token - Token to match.
new - New token to replace with.
[N] - If N = 0, all matching tokens, otherwise the Nth match. (Optional, default is 1)
C - The ASCII value to tokenize by.

Example

; Replace the first token matching 'B' with 'E'
//echo -ag $reptokcs(a.B.b.c.d,B,E,1,46)

; Replace all tokens matching 'B' with 'e'
//echo -ag $reptokcs(B.B.B.b,B,e,0,46)

Updated by Per Amundsen about 9 years ago · 2 revisions

Also available in: PDF HTML TXT