(string)
return vim.eval(f"strtrans('{escaped_string}')")
Convert special characters like '' to '^D'.
Convert special characters like '' to '^D'.
Convert special characters like to ^D .
def strtrans(string):
    """Convert special characters like '' to '^D'."""
    escaped_string = string.replace("'", "\\'").replace("\\", "\\\\")
    return vim.eval(f"strtrans('{escaped_string}')")
def strtrans ( string ) : escaped_string = string . replace ( "'" , "\\'" ) . replace ( "\\" , "\\\\" ) return vim . eval ( f"strtrans('{escaped_string}')" )