@tempots/std

surroundString() function

Surrounds a string with the contents of left and right. If right is omitted, left will be used on both sides

Signature:

surroundString: (s: string, left: string, right?: string) => string

Parameters

Parameter

Type

Description

s

string

The string to surround.

left

string

The left side of the surrounding text.

right

string

(Optional) The right side of the surrounding text. Defaults to left.

Returns: string

The surrounded string.