Latest 0.0.6
Homepage https://github.com/sadawi/StringInflections
License MIT
Platforms ios 9.0, requires ARC
Authors

Case

"just in CASE":

  • string.camelcased(): "justInCase"
  • string.camelcased(uppercaseFirst: true): "JustInCase"
  • string.underscored(): "just_in_case"
  • string.kebabCased(): "just-in-case"

There’s also a StringCase enum.

"my string".to(case: .camel)

Plural and singular

This does very simple, non-localized inflection.

  • string.pluralized()
  • string.singularized()

You can add your own regex-based rules:

Inflector.pluralizer.inflect("octopus$", as: "octopodes")
"octopus".pluralized() // "octopodes"

Inflector.singularizer.inflect("people$", as: "soylent")
"people".singularized() // "soylent"

Latest podspec

{
    "name": "StringInflections",
    "version": "0.0.6",
    "summary": "Methods to pluralize, singularize, camelcase, and underscore strings",
    "homepage": "https://github.com/sadawi/StringInflections",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Sam Williams": "[email protected]"
    },
    "source": {
        "git": "https://github.com/sadawi/StringInflections.git",
        "tag": "0.0.6"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "StringInflections/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This