local data = _objectWrappers:wrap(_arrays:arrayOf(_plugins:loadClass("java.lang.String"), nil, "two", "three", "four", nil)) -- 获取第一个非空的字符串长度 local firstNonNullLength = data:firstNotNullOf(function(it) if (it ~= nil) then return _objectWrappers:wrap(it):count() else return nil end end) -- 输出:第一个非空的字符串长度: 3 _console:log("第一个非空的字符串长度: ", firstNonNullLength)