/
How to convert a string to a numeric value?

How to convert a string to a numeric value?

Q

How to convert a string to a numeric value?

A

Use the string.byte() operator.

Example Code:

string.byte(”a”) -- will result a numeric value 97
string.byte(”abcde”,2) –- will result a numeric value 98 (”b”)
string.byte(”abcde”,-1) –- will result a numeric value 101 (”e”)

Related content

How can I declare special characters in a string?
How can I declare special characters in a string?
More like this
How can a UINT32 value represeting a float value been decoded as float?
How can a UINT32 value represeting a float value been decoded as float?
More like this
How can variables of the type string be merged together?
How can variables of the type string be merged together?
More like this
How do I get the length of a string?
How do I get the length of a string?
More like this
A part of a string variable shall be assigned to another variable, how does it work?
A part of a string variable shall be assigned to another variable, how does it work?
More like this
Do variables need a data type?
Do variables need a data type?
More like this