stringLength
builtins.stringLength
Primop
Docs pulled from | This Revision | about 10 hours ago
Nix manual
Takes 1 arguments
e
Return the number of bytes of the string e. If e is not a string, evaluation is aborted.
Noogle detected
Detected Type
stringLength :: String -> Int
Implementation
This function is implemented in c++ and is part of the native nix runtime.
static void prim_stringLength(EvalState & state, const PosIdx pos, Value ** args, Value & v)
{
NixStringContext context;
auto s =
state.coerceToString(pos, *args[0], context, "while evaluating the argument passed to builtins.stringLength");
v.mkInt(NixInt::Inner(s->size()));
}