GLib.Regex.escape_nul

function escape_nul(string: String, length: Number(gint)): String {
    // Gjs wrapper for g_regex_escape_nul()
}
  

Escapes the nul characters in string to "\x00". It can be used to compile a regex with embedded nul characters.

For completeness, length can be -1 for a nul-terminated string. In this case the output string will be of course equal to string.

Since 2.30

string

the string to escape

length

the length of string

Returns

a newly-allocated escaped string