Table of Contents

Method ToSnakeCasePreservingNumbers

Namespace
YndigoBlue.Velocity.Utils
Assembly
YndigoBlue.Velocity.dll

ToSnakeCasePreservingNumbers(string)

Converts a string to snake_case while preserving boundaries between letters and digits as separate segments.

public static string ToSnakeCasePreservingNumbers(this string input)

Parameters

input string

The string to convert.

Returns

string

The snake_case representation of the input, with letter-digit boundaries separated by underscores.

Remarks

Unlike a standard snake_case conversion, this method inserts an underscore at letter-digit and digit-letter boundaries before applying the conversion (e.g., "Line1" becomes "line_1" rather than "line1").