query
On this page

escapeNixIdentifier

lib.strings.escapeNixIdentifier

Docs pulled from | This Revision | 40 minutes ago


Quotes a string if it can't be used as an identifier directly.

Inputs

s

1. Function argument

Type

string -> string

Examples

escapeNixIdentifier usage example

escapeNixIdentifier "hello"
=> "hello"
escapeNixIdentifier "0abc"
=> "\"0abc\""