isaacscript-common 1.2.162 → 1.2.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function capitalizeFirstLetter(string: string): string;
|
|
1
2
|
export declare function stringContains(string: string, searchString: string): boolean;
|
|
2
3
|
/** Helper function to trim a prefix from a string, if it exists. Returns the trimmed string. */
|
|
3
4
|
export declare function trimPrefix(string: string, prefix: string): string;
|
|
@@ -4,6 +4,12 @@ local __TS__StringStartsWith = ____lualib.__TS__StringStartsWith
|
|
|
4
4
|
local __TS__StringSlice = ____lualib.__TS__StringSlice
|
|
5
5
|
local __TS__StringEndsWith = ____lualib.__TS__StringEndsWith
|
|
6
6
|
local ____exports = {}
|
|
7
|
+
function ____exports.capitalizeFirstLetter(self, ____string)
|
|
8
|
+
local firstCharacter = string.sub(____string, 1, 1)
|
|
9
|
+
local capitalizedFirstLetter = string.upper(firstCharacter)
|
|
10
|
+
local restOfString = string.sub(____string, 2)
|
|
11
|
+
return capitalizedFirstLetter .. restOfString
|
|
12
|
+
end
|
|
7
13
|
function ____exports.stringContains(self, ____string, searchString)
|
|
8
14
|
return (string.find(____string, searchString, nil, true) or 0) - 1 ~= -1
|
|
9
15
|
end
|