AscB - VBScript


The AscB command in VB Script is used to retrieve the ASCII code of the first character in a specified string. It is commonly employed to determine the Unicode value of a character and is particularly useful for handling character encoding, data manipulation, and text processing tasks.



| Parameter | Description |
| string | The string from which the first character’s ASCII code is to be obtained. |



Common Issues

It’s important to note that AscB only returns the ASCII code of the first character in the provided string. If you need to obtain the ASCII codes of subsequent characters, you can use the Asc function, which iterates through the entire string and returns an array of ASCII codes.


AscB can be seamlessly integrated with other VB Script commands or tools for advanced tasks. For instance, it can be used in conjunction with the Chr function to convert ASCII codes back into characters. Additionally, it can be utilized in loops or conditional statements to perform data filtering or validation based on character values.

  • Asc: Returns an array of ASCII codes for all characters in a specified string.
  • StringMid: Extracts a substring of specified length from a given string.
  • Chr: Converts an ASCII code into the corresponding character.