Options
All
  • Public
  • Public/Protected
  • All
Menu

Module snakeCase

Index

Functions String

String Functions

  • default(string: any): string
  • Converts string to snake case.

    since

    3.0.0

    see

    camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst

    example

    snakeCase('Foo Bar') // => 'foo_bar'

    snakeCase('fooBar') // => 'foo_bar'

    snakeCase('--FOO-BAR--') // => 'foo_bar'

    snakeCase('foo2bar') // => 'foo_2_bar'

    Parameters

    • string: any

    Returns string

    Returns the snake cased string.