mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[chore, documentation] Fix up util.stringStartsWith/stringEndsWith LDoc comments (#7292)
Cf. <https://github.com/koreader/koreader/issues/7286#issuecomment-778855817>.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user