Package 'heck'

Title: Highly Performant String Case Converter
Description: Provides a case conversion between common cases like CamelCase and snake_case. Using the 'rust crate heck' <https://github.com/withoutboats/heck> as the backend for a highly performant case conversion for 'R'.
Authors: Josiah Parry [aut] , Dyfan Jones [cre]
Maintainer: Dyfan Jones <[email protected]>
License: MIT + file LICENSE
Version: 0.1.3
Built: 2024-11-10 02:58:38 UTC
Source: https://github.com/DyfanJones/heck

Help Index


Convert string depending case preference

Description

Convert string depending case preference

Usage

to_kebab_case(x)

to_lower_camel_case(x)

to_upper_camel_case(x)

to_pascal_case(x)

to_snake_case(x)

to_snek_case(x)

to_title_case(x)

to_train_case(x)

to_shouty_kebab_case(x)

to_shouty_snake_case(x)

Arguments

x

A character vector to be converted.

Value

  • to_kebab_case() returns character vector in kebab case i.e. "kebab-case"

  • to_lower_camel_case() returns character vector in lower camel case i.e. "lowerCamelCase"

  • to_upper_camel_case() returns character vector in upper camel case i.e. "UpperCammelCase"

  • to_pascal_case() returns character vector in pascal case i.e. "PascalCase"

  • to_snake_case() returns character vector in snake case i.e. "snake_case"

  • to_snek_case() returns character vector in snake case i.e. "snek_case"

  • to_title_case() returns character vector in title case i.e. "Title Case"

  • to_train_case() returns character vector in train case i.e. "Train-Case"

  • to_shouty_kebab_case() returns character vector in shouty kebab case i.e. "SHOUTY-KEBAB-CASE"

  • to_shouty_snake_case() returns character vector in shouty snake case i.e. "SHOUTY_SNAKE_CASE"

Examples

x <- "Demo String"

to_kebab_case(x)

to_lower_camel_case(x)
to_upper_camel_case(x)

to_pascal_case(x)

to_snake_case(x)
to_snek_case(x)

to_title_case(x)
to_train_case(x)

to_shouty_kebab_case(x)
to_shouty_snake_case(x)