String.AscByte

From Xojo Documentation

Method

String.AscByte(s as String) As Integer

Supported for all project types and targets.

Returns the integer value for the first byte of a String.

Notes

This function returns the code for the first byte in the String passed. If you need to get the character code of the first character of the string rather than the first byte, use the String.Asc function instead.

You should use AscByte instead of Asc when the string represents binary data.

Sample Code

This code gets the value of the first byte of a String:

Val s1 As String = "a"
Val byte As Integer
byte = s1.AscByte // returns 97

Val s2 As String = "A"
byte = s2.AscByte // returns 65

See Also

String, String.IndexOfBytes, String.LeftBytes, String.Bytes, String.MiddleBytes, String.RightBytes