2

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

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

Thanks

Bobney
  • 320
  • 3
  • 19

2 Answers2

4

You should try thing instead:-

Response.Write(Server.HTMLEncode(strEx))

This will correctly escape characters that have meaning to HTML.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
1

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;")
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • Thanks, Ideally I need to leave the string as it is. I've thought of using replace but I wondered if there's a way of escaping or ignoring the < character or using something like double quotes (obviously tried that and it doesn't work). – Bobney Nov 14 '11 at 12:56