Method

# Asc

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Returns the integer code point for the first character in the string using the character's encoding.

## Usage

``` xojo
result = stringVariable.Asc
```

| Part           | Type                               | Description                                                 |
|----------------|------------------------------------|-------------------------------------------------------------|
| result         | `Integer</api/data_types/integer>` | The ASCII value of the first character of *stringVariable*. |
| stringVariable | `String</api/data_types/string>`   | Any variable of type `String</api/data_types/string>`.      |

## Notes

The <span class="title-ref">Asc</span> function returns the [code point](http://en.wikipedia.org/wiki/Code_point) for the first character in the passed `String</api/data_types/string>` in the characters encoding. Characters 0 through 127 are the standard ASCII set, which are the same on practically every encoding.

If you need to get the ASCII code of the first byte of the string rather than the first character, use the `String.AscByte<string.ascbyte>` function.

## Sample code

This example uses the <span class="title-ref">Asc</span> function to get the ASCII value of a character.

``` xojo
Var result As Integer
Var source As String = "A"
result = source.Asc ' returns 65
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This example gets the code point for the "&#8805;" symbol

``` xojo
Var source As String = "≥"
Var result As Integer
result = source.Asc
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`String</api/data_types/string>` for a complete list of functions; `TextEncoding</api/text/encoding_text/textencoding>` class.

</div>
