Kit
Functions

removeNullCharacters

removeNullCharacters(value): string

Removes all null characters (\u0000) from a string.

This function cleans a string by stripping out any null characters, which are often used as padding in fixed-size string encodings.

Parameters

ParameterTypeDescription
valuestringThe string to process.

Returns

string

The input string with all null characters removed.

Example

Removing null characters from a string.

removeNullCharacters('hello\u0000\u0000'); // "hello"

On this page