Bobney
Bobney

Reputation: 320

VB Script ignore special character

any idea how to ignore a < or > in a VBS string ie:

strEx = "<10 days"
response.write(strEx)

Thanks

Upvotes: 2

Views: 1714

Answers (2)

AnthonyWJones
AnthonyWJones

Reputation: 189457

You should try thing instead:-

Response.Write(Server.HTMLEncode(strEx))

This will correctly escape characters that have meaning to HTML.

Upvotes: 4

Rory McCrossan
Rory McCrossan

Reputation: 337560

By ignore, do you mean remove? If so try this:

strEx = replace("<10 days", "<", "")

Or if you'd like to write your string on to a webpage, you can encode the < to have it outputted correctly:

strEx = replace("<10 days", "<", "&lt;")

Upvotes: 1

Related Questions