bytes starts-with for bytes
Check if binary data starts with a pattern.
Signature
> bytes starts-with {flags} (pattern) ...rest
Parameters
-
pattern: The pattern to match. -
...rest: For a data structure input, check if bytes at the given cell paths start with the pattern.
Input/output types:
| input | output |
|---|---|
| binary | bool |
| table | table |
| record | record |
Examples
Checks if binary starts with 0x[1F FF AA].
> 0x[1F FF AA AA] | bytes starts-with 0x[1F FF AA] true
Checks if binary starts with 0x[1F].
> 0x[1F FF AA AA] | bytes starts-with 0x[1F] true
Checks if binary starts with 0x[1F].
> 0x[1F FF AA AA] | bytes starts-with 0x[11] false
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/bytes_starts-with.html