Swiftpack.co - Package - domcorvasce/decamelize

decamelize

Build Status

Convert a camelized string into a lowercase one

Inspired by Sindre Sorhus' decamelize Node package

Install

In your Package.swift, under dependencies you can add:

// ...
dependencies: [
    // ...
    .package(url: "https://github.com/domcorvasce/decamelize", from: "1.0.0"),
],
// ...

Usage

import decamelize

print(decamelize("thisHasSpecialCharactersLikeČandŠ"))
//=> this_has_special_characters_like_čand_š

print(decamelize("slimShady", "-"))
//=> slim-shady

API

decamelize

| Parameter | Type | Optional | Default | | -------------------------------- | --------- | -------- | ------- | | string (1st param) | String | No | | | separator (2nd param) | String | Yes | _ |

License

decamelize is released under MIT License

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total:

Releases

1.0.0 - Mar 9, 2019