luaL_optstring

const char *luaL_optstring (lua_State *L, int narg, const char *d);

If the function argument narg is a string, returns this string. If this argument is absent or is nil, returns d. Otherwise, raises an error.