@tennoseremel If I got you right, it will be something like that:
(defun zap-back-up-to-char (char)
"Zap back to a character CHAR from the end of the line"
(interactive "cZap back to char: ")
(let ((end (save-excursion (move-end-of-line 1) (point)))
(start (save-excursion
(move-end-of-line 1)
(search-backward (char-to-string char) nil t))))
(if start
(progn
(delete-region (1+ start) end)
(goto-char (1+ start)))
(error "Character not found"))))
(define-key global-map (kbd "C-M-z") #'zap-back-up-to-char)
@tennoseremel or this one :blobcatthink:
(defun zap-up-to-last-char (char)
"Zap up to the last occurrence of CHAR in the line"
(interactive "cZap up to char: ")
(let ((start (point)))
(let ((end (save-excursion
(move-end-of-line 1)
(search-backward (char-to-string char) start t))))
(if end
(delete-region start end)
(error "Character not found")))))