literal backslash
- From: Andy Chambers <achambers.home@xxxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 15:07:44 -0700 (PDT)
Hi,
How are you supposed to create strings with literal backslashes in
them?
I need a function that takes some string and returns another with any
single quotes backslashed.
(defun js-escape (str)
(with-output-to-string (s)
(loop for char across str do
(case char
(#\' (prin1 "\'" s))
(otherwise (princ char s))))))
I tried various combinations of prin1, princ and print with single and
double backslashes in the "replacement" string above but nothing
seemed to work.
Cheers,
Andy
.
- Follow-Ups:
- Re: literal backslash
- From: Ken Tilton
- Re: literal backslash
- From: Thomas A. Russ
- Re: literal backslash
- From: dkixk
- Re: literal backslash
- From: Ken Tilton
- Re: literal backslash
- Prev by Date: Re: Dynamic variables in CL
- Next by Date: Re: literal backslash
- Previous by thread: Stainless Steel with popular Pendant KP1912 Jewelers
- Next by thread: Re: literal backslash
- Index(es):
Relevant Pages
|