About

The wasChgWord function changes a word by index in sequence of token-delimited words and returns the resulting sequence.

For example:

Say wasChgWord('Search/For/Me', 3, 'Food', '/')

will output: Search/For/Food

Code

/*************************************************************************/
/*    Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3    */
/*************************************************************************/
wasChgWord: procedure /* Change a word in a token delimited string.      */
    Parse ARG String,Index,Replace,Token
    If String = '' Then Return ''
    Parse VAR String Head Interpret(Token) Tail
    Look = wasChgWord(Tail,Index - 1,Replace,Token)
    If Index = 1 Then Head = Replace
    If Look ~= '' Then Return Head || Token || Look
Return Head

fuss/amiga/arexx/token_delimited_words/chgword.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.