Encoder en snake case

Encode l'entrée avec “Encoder en snake case” selon la norme correspondante.

Entrée: TexteRésultat: Texte

Saisie de texte

Options

Exemples

Map an API property to a database-column style

Entrée

createdAt

Expected answer

created_at
Tenter d'être conscient du contexte
Off
Separate an acronym from the next word

HTTP is treated as one word.

Entrée

HTTPResponseCode

Expected answer

http_response_code
Tenter d'être conscient du contexte
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.

Entrée

CO2 concentration ppm

Expected answer

co_2_concentration_ppm
Tenter d'être conscient du contexte
Off
Deburr a city name for a plain ASCII identifier

The original diacritics are removed.

Entrée

São Paulo station

Expected answer

sao_paulo_station
Tenter d'être conscient du contexte
Off
Rename bare tokens while retaining a quoted key

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

Entrée

firstName = "displayName"; maxRetries = 5;

Expected answer

first_name = "displayName"; max_retries = 5;
Tenter d'être conscient du contexte
On
To Snake case (dumb)

Entrée

hello world

Expected answer

hello_world
Tenter d'être conscient du contexte
Off
To Snake case (smart)

Entrée

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");
}
Tenter d'être conscient du contexte
On

Paramètres

ParamètreValeur par défautEntrée et choix
Tenter d'être conscient du contextefalseActivé ou désactivé

Outils associés

Nettoyage du code

Référence de l’opération

Voir la documentation technique originale (English)