Package Exports
- @aceworks-studio/string
- @aceworks-studio/string/src/init.lua
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@aceworks-studio/string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@aceworks-studio/string
A set of utility functions for string manipulation.
Installation
Add @aceworks-studio/string in your dependencies:
yarn add @aceworks-studio/stringOr if you are using npm:
npm install @aceworks-studio/stringContent
contains
function contains(value: string, substring: string): booleanChecks if the given string value contains substring.
endsWith
function endsWith(value: string, suffix: string): booleanChecks if the given string value ends with the specified suffix suffix. Returns true if value ends with suffix, otherwise false.
startsWith
function startsWith(value: string, prefix: string): booleanChecks if the given string value starts with the specified prefix prefix. Returns true if value starts with prefix, otherwise false.
trim
function trim(value: string): stringRemoves whitespace from both ends of the given string. Returns the trimmed string.
trimEnd
function trimEnd(value: string): stringRemoves whitespace from the end of the given string. Returns the trimmed string.
trimStart
function trimStart(value: string): stringRemoves whitespace from the beginning of the given string. Returns the trimmed string.
License
This project is available under the MIT license. See LICENSE.txt for details.
Other Lua Environments Support
If you would like to use this library on a Lua environment where it is currently incompatible, open an issue (or comment on an existing one) to request the appropriate modifications.
The library uses darklua to process its code.