TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Arch_Eric on May 27, 2008, 12:18:50 PM

Title: String replace function
Post by: Arch_Eric on May 27, 2008, 12:18:50 PM
I can't remember if it was here or the other place, but I remember somebody posting a string replace function that worked like:
Code: [Select]
(strrep "This %%1 will have %%2 new %%3 in it." "string" 3 "words")
And would produce "This string will have 3 new words in it." I was going to make one of my own, but didn't know how to handle a variable number of...variables. I guess I could make the new strings into a list when calling the func.
Title: Re: String replace function
Post by: daron on May 27, 2008, 12:36:56 PM
You could start here (http://www.theswamp.org/index.php?topic=22840.msg275074#msg275074).
Title: Re: String replace function
Post by: Arch_Eric on May 27, 2008, 12:51:05 PM
Thanks.  I knew I had seen it, was just searching for the wrong thing.  :ugly: