- String manipulation functions
- cstr_escape()
- json
.escape() - regsub()
- regsuball()
- std
.anystr2ip() - std
.atof() - std
.atoi() - std
.ip() - std
.ip2str() - std
.prefixof() - std
.str2ip() - std
.strlen() - std
.strpad() - std
.strrep() - std
.strrev() - std
.strstr() - std
.strtof() - std
.strtol() - std
.suffixof() - std
.tolower() - std
.toupper() - substr()
- urldecode()
- urlencode()
- utf8
.codepoint_count() - utf8
.is_valid() - utf8
.strpad() - utf8
.substr()
std.atoi()
Takes a string (which represents an integer) as an argument and returns its value. Behaves as if calling std.strtol()
with a base of 10.
Format
INTEGER
std.atoi(STRING s)
Examples
1
2
3
if (std.atoi(req.http.X-Decimal) == 42) {
set req.http.X-TheAnswer = "Found";
}