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: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


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