Categories Core


canint( string );

Checks if a string can safely be turned into an integer and returns true or false. In order for a string to be safe to convert, it must begin with a digit.

Use example:

local x = "12 Days of Christmas";
local y = 0;

if(canint(x)) y = x.tointeger();

Search results