StringCase

1.0.1

👇👆🐍 Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
Cosmo/StringCase

What's New

2019-09-02T12:55:10Z

StringCase

Converts String to lowerCamelCase, UpperCamelCase and snake_case.

Usage

Transformation

let input = "Keynote Event"

input.lowerCamelCased() // "keynoteEvent"
input.upperCamelCased() // "KeynoteEvent"
input.snakeCased()      // "keynote_event"
let input = "_this is*  not-Very%difficult"

input.lowerCamelCased() // "thisIsNotVeryDifficult"
input.upperCamelCased() // "ThisIsNotVeryDifficult"
input.snakeCased()      // "this_is_not_very_difficult"

Boolean checks

"KeynoteEvent".isLowerCamelCased    // false
"keynoteEvent".isLowerCamelCased    // true
"keynote_event".isLowerCamelCased   // false
"KeynoteEvent".isUpperCamelCased    // true
"keynoteEvent".isUpperCamelCased    // false
"keynote_event".isUpperCamelCased   // false
"KeynoteEvent".isSnakeCase          // false
"keynoteEvent".isSnakeCase          // false
"keynote_event".isSnakeCase         // true

Contact

License

StringCase is released under the MIT License.

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Oct 21 2024 15:45:12 GMT-0900 (Hawaii-Aleutian Daylight Time)