https://github.com/cosmo/stringcase
👇👆🐍 Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
https://github.com/cosmo/stringcase
hacktoberfest
Last synced: 12 months ago
JSON representation
👇👆🐍 Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
- Host: GitHub
- URL: https://github.com/cosmo/stringcase
- Owner: Cosmo
- License: mit
- Created: 2019-09-01T23:21:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-30T10:19:47.000Z (almost 5 years ago)
- Last Synced: 2025-03-21T05:22:09.826Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StringCase
Converts `String` to `lowerCamelCase`, `UpperCamelCase` and `snake_case`.
## Usage
### Transformation
```swift
let input = "Keynote Event"
input.lowerCamelCased() // "keynoteEvent"
input.upperCamelCased() // "KeynoteEvent"
input.snakeCased() // "keynote_event"
```
```swift
let input = "_this is* not-Very%difficult"
input.lowerCamelCased() // "thisIsNotVeryDifficult"
input.upperCamelCased() // "ThisIsNotVeryDifficult"
input.snakeCased() // "this_is_not_very_difficult"
```
### Boolean checks
```swift
"KeynoteEvent".isLowerCamelCased // false
"keynoteEvent".isLowerCamelCased // true
"keynote_event".isLowerCamelCased // false
```
```swift
"KeynoteEvent".isUpperCamelCased // true
"keynoteEvent".isUpperCamelCased // false
"keynote_event".isUpperCamelCased // false
```
```swift
"KeynoteEvent".isSnakeCase // false
"keynoteEvent".isSnakeCase // false
"keynote_event".isSnakeCase // true
```
## Contact
* Devran "Cosmo" Uenal
* Twitter: [@maccosmo](http://twitter.com/maccosmo)
* LinkedIn: [devranuenal](https://www.linkedin.com/in/devranuenal)
## Other Projects
* [BinaryKit](https://github.com/Cosmo/BinaryKit) — BinaryKit helps you to break down binary data into bits and bytes and easily access specific parts.
* [Clippy](https://github.com/Cosmo/Clippy) — Clippy from Microsoft Office is back and runs on macOS! Written in Swift.
* [GrammaticalNumber](https://github.com/Cosmo/GrammaticalNumber) — Turns singular words to the plural and vice-versa in Swift.
* [HackMan](https://github.com/Cosmo/HackMan) — Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
* [ISO8859](https://github.com/Cosmo/ISO8859) — Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.
* [SpriteMap](https://github.com/Cosmo/SpriteMap) — SpriteMap helps you to extract sprites out of a sprite map. Written in Swift.
* [TinyConsole](https://github.com/Cosmo/TinyConsole) — TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.
## License
StringCase is released under the [MIT License](http://www.opensource.org/licenses/MIT).