[chore, documentation] Fix up util.stringStartsWith/stringEndsWith LDoc comments (#7292)

Cf. <https://github.com/koreader/koreader/issues/7286#issuecomment-778855817>.
reviewable/pr7294/r1
Frans de Jonge 3 years ago committed by GitHub
parent 7a742a2e64
commit 9f2c45284b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1200,18 +1200,20 @@ function util.checkLuaSyntax(lua_text)
return err
end
-- Simple startsWith / endsWith string helpers
-- c.f., http://lua-users.org/wiki/StringRecipes
-- @param str string: source string
-- @param start string: string to match
-- @return boolean: true on success
--- Simple startsWith string helper.
--
-- C.f., <http://lua-users.org/wiki/StringRecipes>.
-- @string str source string
-- @string start string to match
-- @treturn bool true on success
function util.stringStartsWith(str, start)
return str:sub(1, #start) == start
end
-- @param str string: source string
-- @param ending string: string to match
-- @return boolean: true on success
--- Simple endsWith string helper.
-- @string str source string
-- @string ending string to match
-- @treturn bool true on success
function util.stringEndsWith(str, ending)
return ending == "" or str:sub(-#ending) == ending
end

Loading…
Cancel
Save