Project

General

Profile

Actions

$reptok » History » Revision 2

« Previous | Revision 2/4 (diff) | Next »
Per Amundsen, 08/10/2015 06:08 AM


Added in 1.9.0

$reptok(text,token,new,N,C)

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

$reptok is case-insensitive, see $reptokcs for case-sensitive 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.
C - The ASCII value to tokenize by.

Example

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

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

Updated by Per Amundsen over 9 years ago · 2 revisions

Also available in: PDF HTML TXT