Codificar como Snake case

Codifica a entrada com “Codificar como Snake case” de acordo com o padrão correspondente.

Entrada: TextoResultado: Texto

Entrada de texto

Opções

Exemplos

Map an API property to a database-column style

Entrada

createdAt

Expected answer

created_at
Tentar ser consciente do contexto
Off
Separate an acronym from the next word

HTTP is treated as one word.

Entrada

HTTPResponseCode

Expected answer

http_response_code
Tentar ser consciente do contexto
Off
Normalize a measurement heading containing a number

The digit 2 forms its own word boundary; inspect the exact output before adopting a schema name.

Entrada

CO2 concentration ppm

Expected answer

co_2_concentration_ppm
Tentar ser consciente do contexto
Off
Deburr a city name for a plain ASCII identifier

The original diacritics are removed.

Entrada

São Paulo station

Expected answer

sao_paulo_station
Tentar ser consciente do contexto
Off
Rename bare tokens while retaining a quoted key

Context mode protects double-quoted text; review real code with its parser before applying replacements.

Entrada

firstName = "displayName"; maxRetries = 5;

Expected answer

first_name = "displayName"; max_retries = 5;
Tentar ser consciente do contexto
On
To Snake case (dumb)

Entrada

hello world

Expected answer

hello_world
Tentar ser consciente do contexto
Off
To Snake case (smart)

Entrada

test='hello'
echo $test
aSnakeCaseFunction
$aSnakeCaseVariable;
function functionName() {
  console.log('things inside quotes do not get broken');
  console.log("things inside quotes do not get broken");
}

Expected answer

test='hello'
echo $test
a_snake_case_function
$a_snake_case_variable;
function function_name() {
  console.log('things inside quotes do not get broken');
  console.log("things inside quotes do not get broken");
}
Tentar ser consciente do contexto
On

Parâmetros

ParâmetroValor padrãoEntrada e opções
Tentar ser consciente do contextofalseAtivado ou desativado

Ferramentas relacionadas

Organização de código

Referência da operação

Ver a documentação técnica original (English)