User Tools

Site Tools


# $EPIC: joinstr.txt,v 1.2 2007/02/15 03:53:35 jnelson Exp $


$joinstr(seperator var1 var2)


This function joins two word lists together with a seperator. Formally: This function returns a word list wherein the Nth word of the return value is the string catenation of the Nth word of $var1, the seperator, and the Nth word of $var2. Please note that var1 and var2 must be variable names, not the values themselves.

You can join together more than two variables in this way: just list the variable names.

If one variable has less words than another variable, then the empty value is used to hold the place of any missing words.


If you had two variables, one containing nicks and the other containing user@hosts, you might use a function like copattern to turn user@host wildcards into nicknames. But if you wanted to create nick!user@hosts, you could use this function:

@nicks = [one two three]
@userhosts = []
@nuh = joinstr(! nicks userhosts)
echo $nuh

would output

one! two! three!


The joinstr function first appeared in EPIC4-1.1.8. The ability to join more than two variables first appeared in EPIC4-1.1.15.

joinstr.txt · Last modified: 2007/02/15 03:53 (external edit)