Background for Skyrim SE
Member of the StringUtil script
intfunctionAsOrd(stringc)NativeGlobal

Description

Wiki Description

Returns the decimal equivalent of the given character. (This function requires SKSE)

Documentation Comment

returns the numeric value of the first character as an int


Caveats

CK Wiki - Notes

This function returns the decimal equivalent, not the hexadecimal equivalent.
This function is case-insensitive (like all SKSE string functions right now).


Parameters

stringc

CK Wiki Description

The character to convert to decimal. Converts only the first character in the given string.


Examples

Import StringUtil

String myString = "a"
Int decimal = AsOrd(myString) ; decimal == 65 == A

myString = "A"
decimal = AsOrd(myString) ; decimal == 65 == A

myString = "Long string"
decimal = AsOrd(myString) ; decimal == 76 == L

myString = ""
decimal = AsOrd(myString) ; decimal == 0

Auto-Generated Example

string myString__c

int returnedValue = StringUtil.AsOrd(myString__c)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.