Export (0) Print
Expand All
Expand Minimize
2 out of 4 rated this helpful - Rate this topic

Converting VBScript's Chr Function


Windows PowerShell


Definition: Returns the character associated with the specified ANSI character code.

Chr

Here’s a question for you: Suppose you have an ASCII value and you need to convert that value to a real character; how are you supposed to do that?

Well, one way is to simply take the integer value (ASCII values are always integer values) and convert its data type to character. This command converts ASCII 34 to a character value and then stores that value in the variable $a:


$a = [char]34

When you run this command and then echo back the value of $a you should get the following:


"


Return to the VBScript to Windows PowerShell home page

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.