ValentinWalter / StringCase

πŸ‘‡πŸ‘†πŸ Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StringCase

Converts String to lowerCamelCase, UpperCamelCase, snake_case and kebab-case.

Usage

Transformation

let input = "Keynote Event"

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

input.lowerCamelCased() // "thisIsNotVeryDifficult"
input.upperCamelCased() // "ThisIsNotVeryDifficult"
input.snakeCased()      // "this_is_not_very_difficult"
input.kebabCased()      // "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
"KeynoteEvent".isKebabCase          // false
"keynoteEvent".isKebabCase          // false
"keynote-event".isKebabCase         // true

Contact

Other Projects

  • BinaryKit β€” BinaryKit helps you to break down binary data into bits and bytes and easily access specific parts.
  • Clippy β€” Clippy from Microsoft Office is back and runs on macOS! Written in Swift.
  • GrammaticalNumber β€” Turns singular words to the plural and vice-versa in Swift.
  • HackMan β€” Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
  • ISO8859 β€” Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.
  • SpriteMap β€” SpriteMap helps you to extract sprites out of a sprite map. Written in Swift.
  • 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.

About

πŸ‘‡πŸ‘†πŸ Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.

License:MIT License


Languages

Language:Swift 100.0%