I need to remove a character from a string, but I can't figure out how to specify a count, that is a limit on how many times said character should be removed from string in Chicken.
Here's how I'd do it in Common Lisp:
(let ((a "abca")) (delete #\a a :count 1))
;=> "bca"
How would I do that in Chicken-scheme?
I've tried using delete in Chicken, but Chicken's delete doesn't seem to support a count thingy thing, so the following does not work:
(let ((a "abca")) (list->string (delete #\a (string->list a) :count 1)) ))
And just running delete on a string removes all occurrences of char:
(let ((a "abca")) (list->string (delete #\a (string->list a)) ))
;=> "bc"