Skip to content

Modern String Unescape

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › String Library › String Library › Unescape

Unescape

Turns backslash escapes back into the characters they stand for.

Syntax

Unescape( s )

Notes

  • O(n)

Examples

#import "std/strings"
using strings

print Unescape( "line\nnext" )      '' two lines
print Unescape( "\x41\x42" )       '' AB
print Unescape( "\q" )             '' q -- an unrecognised escape yields the character

'' The exact inverse of Escape, for every input
dim as ustring s = "a\b" & chr(9) & """q"""
if Unescape( Escape( s ) ) = s then print "round trip holds"

Library: String Library
Category: String Library
Documented under: The Functions

Clone this wiki locally