# Examples

Let's create a wrap for the BBCode tag.

```typescript
// Example usage.
import { Wrap } from '@angular-package/text';

// Let's create a BBCode wrap.
const BBCodeWrap = new Wrap('[', ']');

// Make a [quote] BBCode tag. Returns Wrapped {'[quote]'}
const quoteTag = BBCodeWrap.wrapText('quote');
console.log(quoteTag);
quoteTag.opening; // Returns [
quoteTag.closing; // Returns ]
quoteTag.text; // Returns [quote]
quoteTag.value; // Returns [quote]
quoteTag.unwrap(); // Returns quote
quoteTag.valueOf(); // Returns [quote]

// Make a [img] BBCode tag. Returns Wrapped {'[img]'}
const imgTag = BBCodeWrap.wrapText('img');
```

Let's create a wrap for the HTML tag.

```typescript
// Example usage.
import { Wrap } from '@angular-package/text';

// Let's create a HTML wrap.
const HTMLWrap = new Wrap('<', '>');

// Returns Wrapped {'<span>'}
const spanTag = HTMLWrap.wrapText('span');
spanTag.opening; // Returns <
spanTag.closing; // Returns >
spanTag.text; // Returns <span>
spanTag.value; // Returns <span>
spanTag.unwrap(); // Returns span
spanTag.valueOf(); // Returns <span>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.angular-package.dev/text/wrapper/wrap/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
