|
-
Jan 31st, 2013, 03:17 AM
#1
Thread Starter
Addicted Member
How can I get characters code?
Hello,
I am trying to concat two strings at runtime and between them I want to insert a special character that I found in charmap in windows.
There are many characters and their code is written in the down-left corner of the window.
For example if I want to insert the diameter (Ø) character in a string that has U+00D8 how do I make this at runtime.
Also I will have to check if this character exists or not in a textbox. (If textBox1.Text.Contains(......code???......) Then...)
Thx.
-
Jan 31st, 2013, 03:31 AM
#2
Re: How can I get characters code?
The U+00D8 means a Unicode value of D8 in hexadecimal, which is 216 in decimal. The Convert.ToChar method will create a Char from an Integer containing its Unicode value, e.g.
Code:
Dim ch = Convert.ToChar(&HD8)
You can then concatenate a Char with a String exactly as you would another String.
-
Feb 1st, 2013, 04:26 AM
#3
Thread Starter
Addicted Member
Re: How can I get characters code?
Thank you. I got it.
Cheers
-
Feb 1st, 2013, 09:54 AM
#4
Hyperactive Member
Re: How can I get characters code?
Since it sounds like you may use this character often, you may consider creating a static variable so that wherever you you it, you can just use the static variable instead of having to keep using Covert.ToChar() function all over the place.
-
Feb 1st, 2013, 05:44 PM
#5
Re: How can I get characters code?
Is there any reason why Chr(&HD8) isn't adequate here?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|