minor visual fixes

This commit is contained in:
Van
2025-03-06 07:42:38 +00:00
parent b294fc3d90
commit 25cb25d065

View File

@@ -12,9 +12,11 @@ local cyrillic_alphabet = {
["Ю"] = "ю", ["Я"] = "я", ["Ю"] = "ю", ["Я"] = "я",
} }
string.replace = string.gsub
--- Same as `string.lower` but with cyrillic support. --- Same as `string.lower` but with cyrillic support.
--- @param str string Input string. --- @param str string Input string.
--- @return string --- @return string
function string.lower_cyrillic(str) function string.lower_cyrillic(str)
-- assert -- assert
@@ -27,8 +29,8 @@ function string.lower_cyrillic(str)
end end
--- Same as `string.upper` but with cyrillic support. --- Same as `string.upper` but with cyrillic support.
--- @param str string Input string. --- @param str string Input string.
--- @return string --- @return string
function string.upper_cyrillic(str) function string.upper_cyrillic(str)
-- assert -- assert
@@ -41,8 +43,8 @@ function string.upper_cyrillic(str)
end end
--- Writes a string with a capital letter. Doesn't work with cyrillic. --- Writes a string with a capital letter. Doesn't work with cyrillic.
--- @param str string Input string. --- @param str string Input string.
--- @return string --- @return string
function string.capitalize(str) function string.capitalize(str)
-- assert -- assert
@@ -50,8 +52,8 @@ function string.capitalize(str)
end end
--- Capitalizes each word in a line. Doesn't work with cyrillic. --- Capitalizes each word in a line. Doesn't work with cyrillic.
--- @param str string Input string. --- @param str string Input string.
--- @return string --- @return string
function string.to_title(str) function string.to_title(str)
-- assert -- assert
@@ -64,8 +66,8 @@ function string.to_title(str)
end end
--- Replaces underscores with spaces in a string. --- Replaces underscores with spaces in a string.
--- @param str string Input string. --- @param str string Input string.
--- @return string --- @return string
function string.remove_underscores(str) function string.remove_underscores(str)
-- assert -- assert
@@ -73,9 +75,9 @@ function string.remove_underscores(str)
end end
--- Checks if a string starts with `prefix`. --- Checks if a string starts with `prefix`.
--- @param str string String to check. --- @param str string String to check.
--- @param prefix string The string the `str` should start with. --- @param prefix string The string the `str` should start with.
--- @return boolean --- @return boolean
function string.starts_with(str, prefix) function string.starts_with(str, prefix)
-- assert -- assert
@@ -84,9 +86,9 @@ end
--- Checks if a string end with `prefix`. --- Checks if a string end with `prefix`.
--- @param str string String to check. --- @param str string String to check.
--- @param suffix string The string the `str` should end with. --- @param suffix string The string the `str` should end with.
--- @return boolean --- @return boolean
function string.ends_with(str, suffix) function string.ends_with(str, suffix)
-- assert -- assert
@@ -94,13 +96,11 @@ function string.ends_with(str, suffix)
end end
--- Checks if the string contains a specific substring. --- Checks if the string contains a specific substring.
--- @param str string String to check. --- @param str string String to check.
--- @param sub_string string The text segment to search for within the string. --- @param sub_string string The text segment to search for within the string.
--- @return boolean --- @return boolean
function string.contains(str, sub_string) function string.contains(str, sub_string)
-- assert -- assert
return str:find(sub_string, 1, true) ~= nil return str:find(sub_string, 1, true) ~= nil
end end
string.replace = string.gsub