Xbasic

WORD_REPLACE Function

Syntax

New_List as C = word_replace(C string ,C substring ,C replacement )

Arguments

New_List

The modified list.

string

Character.

substring

A CR-LF delimited list of words or entries.

replacement

The number of the word or entry to remove.

Description

Search CRLF delimited list and replace all occurences of substring with replacement

Discussion

The WORD_REPLACE() function replaces a word or entry in a CR-LF delimited list.

Example

dim s as C
s = <<%a%
bird
cow
chicken
goat
%a%
? word_replace(s, "cow", "bull")
= bird
bull
chicken
goat

See Also