amirfarzamnia/caseluau
v0.1.5 ·
A simple and lightweight Luau library for converting strings between different cases.
Case.luau
A simple and lightweight Luau library for converting strings between different cases.
Installation
To install, use pesde:
# Add to your project
pesde add amirfarzamnia/caseluau
# Install dependencies
pesde install
Usage
local case = require("./luau_packages/caseluau")
-- camelCase
print(case.camel("hello world")) -- "helloWorld"
-- PascalCase
print(case.pascal("hello world")) -- "HelloWorld"
-- snake_case
print(case.snake("hello world")) -- "hello_world"
-- CONSTANT_CASE
print(case.constant("hello world")) -- "HELLO_WORLD"
-- kebab-case
print(case.kebab("hello world")) -- "hello-world"
-- dot.case
print(case.dot("hello world")) -- "hello.world"
-- path/case
print(case.path("hello world")) -- "hello/world"
-- Sentence case
print(case.sentence("hello world")) -- "Hello world"
-- Title Case
print(case.title("hello world")) -- "Hello World"
-- UPPER CASE
print(case.upper("hello world")) -- "HELLO WORLD"
-- lower case
print(case.lower("HELLO WORLD")) -- "hello world"
API
The following functions are available:
case.camel(text: string): stringcase.constant(text: string): stringcase.dot(text: string): stringcase.kebab(text: string): stringcase.lower(text: string): stringcase.pascal(text: string): stringcase.path(text: string): stringcase.sentence(text: string): stringcase.snake(text: string): stringcase.title(text: string): stringcase.upper(text: string): string
License
This project is licensed under the MIT License - see the LICENSE file for details.