novicePrgrmr
novicePrgrmr

Reputation: 19405

ASP classic - JScript: How to escape a single quote (') in a string

OK I'm very embarrassed to ask this, but I am having trouble escaping a single quote from a string in classic ASP. I have tried using chr(39) but that doesn't do the trick.

I am not an ASP classic or JScript guy and hadn't even started coding when it became obsolete.

Here is the string (they are ):

arrStory[136]['Short'] = 'At the end of May, the group's European partners.';

Upvotes: 2

Views: 6765

Answers (1)

user1945782
user1945782

Reputation:

I believe the speech marks in JScript are interchangeable - you should be able to use double speech marks (") for the literal itself, while using single speech marks within.

arrStory[136]["Short"] = "At the end of May, the group's European partners.";

Alternatively try doubling up...

arrStory[136]['Short'] = 'At the end of May, the group''s European partners.';
______________________________________________________^

Upvotes: 4

Related Questions