time-to-botec/js/node_modules/@stdlib/string/remove-utf8-bom
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
bin feat: add the node modules 2022-12-03 12:44:49 +00:00
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
etc feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

Remove UTF-8 BOM

Remove a UTF-8 byte order mark (BOM) from the beginning of a string.

Usage

var removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' );

removeUTF8BOM( str )

Removes a UTF-8 byte order mark (BOM) from the beginning of a string.

var str = removeUTF8BOM( '\ufeffbeep' );
// returns 'beep'

Examples

var removeUTF8BOM = require( '@stdlib/string/remove-utf8-bom' );

var str = removeUTF8BOM( '\ufeffbeep' );
// returns 'beep'

str = removeUTF8BOM( 'boop\ufeff' );
// returns 'boop\ufeff'

str = removeUTF8BOM( 'be\ufeffbop' );
// returns 'be\ufeffbop'

str = removeUTF8BOM( 'foobar' );
// returns 'foobar'

CLI

Usage

Usage: remove-utf8-bom [options] [<string>]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

Assuming a shell which understands escape sequences,

$ remove-utf8-bom "\xEF\xBB\xBFbeep boop"
beep boop

To use as a standard stream,

$ echo -n '\ufeffbeep' | remove-utf8-bom
beep