(self: string): stringConverts a camelCase string to snake_case.
Example (Converting camelCase to snake_case)
import { String } from "effect"
console.log(String.camelToSnake("helloWorld")) // "hello_world"
console.log(String.camelToSnake("fooBarBaz")) // "foo_bar_baz"transforming
Source effect/String.ts:11291 lines
export const const camelToSnake: (
self: string
) => string
Converts a camelCase string to snake_case.
Example (Converting camelCase to snake_case)
import { String } from "effect"
console.log(String.camelToSnake("helloWorld")) // "hello_world"
console.log(String.camelToSnake("fooBarBaz")) // "foo_bar_baz"
camelToSnake = (self: stringself: string): string => self: stringself.String.replace(searchValue: {
[Symbol.replace](string: string, replaceValue: string): string;
}, replaceValue: string): string (+3 overloads)
Passes a string and
{@linkcode
replaceValue
}
to the [Symbol.replace] method on
{@linkcode
searchValue
}
. This method is expected to implement its own replacement algorithm.
replace(/([A-Z])/g, "_$1").String.toLowerCase(): stringConverts all the alphabetic characters in a string to lowercase.
toLowerCase()Referenced by 1 symbols