The problem appears that you are calling a function named 'repstr' which has the same name as parameter to your function. Rename one of them and try again.
Just a thought regarding (repspaces spacestr repstr repnum ) - if you are replacing upto repnum spaces with repstr you can use replace and the regex {min,max} matching operator thus
> (repspaces "Test Test Test Test" "|" 5)
"Test|Test|Test||Test"
>
(there are 6 spaces between the last two "Test"s so two separators)
The forum software font shortens spaces? spaces in the test string are
1, 3, and 6 viz "Test_Test___Test______Test"
Thanks very much.
Yes this was my intention and the use of regex is much better.
regexp has so much power that it need's some time to fiddle out the use of it.