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

Cf. <https://github.com/koreader/koreader/issues/7286#issuecomment-778855817>.
pull/7294/head
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 return err
end end
-- Simple startsWith / endsWith string helpers --- Simple startsWith string helper.
-- c.f., http://lua-users.org/wiki/StringRecipes --
-- @param str string: source string -- C.f., <http://lua-users.org/wiki/StringRecipes>.
-- @param start string: string to match -- @string str source string
-- @return boolean: true on success -- @string start string to match
-- @treturn bool true on success
function util.stringStartsWith(str, start) function util.stringStartsWith(str, start)
return str:sub(1, #start) == start return str:sub(1, #start) == start
end end
-- @param str string: source string --- Simple endsWith string helper.
-- @param ending string: string to match -- @string str source string
-- @return boolean: true on success -- @string ending string to match
-- @treturn bool true on success
function util.stringEndsWith(str, ending) function util.stringEndsWith(str, ending)
return ending == "" or str:sub(-#ending) == ending return ending == "" or str:sub(-#ending) == ending
end end

Loading…
Cancel
Save