Skip to content

Modern String Unwrap

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

Home › String Library › String Library › Unwrap

Unwrap

Removes one surrounding pair of quotes or delimiters, if both are there.

Syntax

Unwrap( s [, open] [, close] [, ic] )

Notes

  • O(n)

Examples

#import "std/strings"
using strings

print Unwrap( "<Paul>", "<", ">" )    '' Paul
print Unwrap( "<Paul", "<", ">" )     '' <Paul -- unbalanced, left untouched
print Unwrap( "''x''", "'" )          '' 'x' -- ONE pair removed, not all
print Unwrap( """quoted""" )          '' quoted -- the default pair

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

Clone this wiki locally