joinstr
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | joinstr [2007/02/15 03:53] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: joinstr.txt, | ||
+ | ======Synopsis: | ||
+ | $[[joinstr]](// | ||
+ | |||
+ | ======Description: | ||
+ | This function joins two word lists together with a seperator. Formally: | ||
+ | This function returns a word list wherein the **N**th word of the return | ||
+ | value is the string catenation of the **N**th word of $//var1//, the | ||
+ | // | ||
+ | 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. | ||
+ | |||
+ | ======Practical: | ||
+ | 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. | ||
+ | you could use this function: | ||
+ | |||
+ | @nicks = [one two three] | ||
+ | @userhosts = [foo@baz.com boo@ya.com bar@oof.com] | ||
+ | @nuh = joinstr(! nicks userhosts) | ||
+ | echo $nuh | ||
+ | |||
+ | would output | ||
+ | |||
+ | one!foo@baz.com two!boo@ya.com three!bar@oof.com | ||
+ | |||
+ | ======History: | ||
+ | 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 by 127.0.0.1