1

I could use some help. How do I explicity convert a string to an int.

Here is an example of what I would like to have working:

string string_num = "" + 1;

int num = cast(string_num);

I've tried searching the internet using the following:

"angelscript convert string to int"

"angelscript cast string to int"

"angelscript dictionary keys to int"

Help would be appreciated.

AS_noob
  • 13
  • 2

1 Answers1

0

https://www.angelcode.com/angelscript/sdk/docs/manual/doc_script_stdlib_string.htm

int64 parseInt(const string &in str, uint base = 10, uint &out byteCount = 0)

so to convert, you'd just call parseInt("1").

Converting from a string to a number is most often described as "parsing" which might be why your searches weren't coming up with anything.

Max Hay
  • 230
  • 2
  • 11