punkrockbuddyholly
punkrockbuddyholly

Reputation: 9794

Is there a tool for finding the Char code of a character?

I am trying to write a VB function to strip unwanted characters from a string. It is for generating a 'clean' url from data that has been inputted into a CMS. Someone has copied and pasted from a Word document and so there appears to be an mdash or ndash in the product title. This results in ─ appearing instead of -

I have tried a Replace(text, Chr(196), Chr(45)) but it isn't working so it can't be 196. Is there a tool or something where I can copy this character and paste it into the tool and it will tell me what char code it is?

Thanks.

Upvotes: 0

Views: 1731

Answers (2)

mastaH
mastaH

Reputation: 1267

Try here or here. From 2nd link I can see that your char is alt150

Upvotes: 1

Yeodave
Yeodave

Reputation: 988

You can make your program write out the Character Code using the finction Asc()

Response.write Asc("-") would write out

45

for example.

Upvotes: 3

Related Questions