I searched google and forums but I could not find anything
There is a lisp function to replace all occurrences of a character within a string?
In short, as the Replace command in Visual Basic
For example, to replace all "x" to "*":
"34x59+60x3" -> "34*59+60*3
Thanks in advance
Solved! Go to Solution.
Solved by martti.halminen. Go to Solution.
One way
(defun rep (n o str) (vl-list->string (mapcar '(lambda (x) (if (= x (ascii o)) (ascii n) x)) (vl-string->list str) ) ) )
(rep "*" "x" "34x59+60x3")----> "34*59+60*3"
@martti.halminen wrote:_$ (vl-string-translate "x" "*" "34x59+60x3")
"34*59+60*3"
--
Of course..
Silly me
Sorry for the delay of my reply!
I tried this solution but I do not know why, had not worked.I probably did something wrong ...
Thanks to all!
Initialize once per session:
(vl-load-com)
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.