Skip to content

Modern String Wrap

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

Home › String Library › String Library › Wrap

Wrap

Surrounds the string with quotes or a given pair of delimiters.

Syntax

Wrap( s [, open] [, close] )

Notes

  • O(n)

Examples

#import "std/strings"
using strings

print Wrap( "Paul" )               '' "Paul" -- double quotes by default
print Wrap( "Paul", "'" )          '' 'Paul' -- an empty closing means "same as opening"
print Wrap( "Paul", "<", ">" )     '' <Paul>

'' A genuinely one-sided wrap is InsertAt's job

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

Clone this wiki locally