# sass-string

> This Sass module provides more advanced string functions

Latest version **1.1.0** (published 2021-08-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install sass-string
pnpm add sass-string
yarn add sass-string
bun add sass-string
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-08-07 |
| First published | 2021-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | roydukkey |
| Maintainers | roydukkey |
| Keywords | sass, scss, dart-sass, string |

## Links

- npm: https://www.npmjs.com/package/sass-string
- Repository: https://github.com/roydukkey/sass-module-string
- Homepage: https://github.com/roydukkey/sass-module-string#readme
- Issues: https://github.com/roydukkey/sass-module-string/issues
- npm.io page: https://npm.io/package/sass-string

## Dependencies (2)

- [sass-list](https://npm.io/package/sass-list.md) ^2.0.0
- [sass-exception](https://npm.io/package/sass-exception.md) ^1.0.0

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-08-07
- 1.0.0 — 2021-07-02

## README

# sass-string

[![Release Version](https://img.shields.io/npm/v/sass-string.svg)](https://www.npmjs.com/package/sass-string)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

This Sass module provides more advanced string functions.

## Install

### Requires

Install the package:

```bash
npm install sass-string
```

Use the package like any other Sass module:

```scss
@use 'sass-string';
```

Depending on your setup, you may need to configure `node_modules` as include path:

```js
const sass = require('sass');

sass.render({
  file: scss_filename,
  includePaths: ['node_modules']
});
```

## Public API

<dl>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_ends-with.sass"><code>ends-with ( $string, $substring [, $end-at] )</code></a></dt>
  <dd>Determines whether a string ends with the characters of a specified substring, returning true or false as appropriate.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_from.sass"><code>from ( $value )</code></a></dt>
  <dd>Creates a string from the provided value.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_includes.sass"><code>includes ( $string, $substring [, $start-at] )</code></a></dt>
  <dd>Determines whether a string includes the characters of a specified substring, returning true or false as appropriate.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_index.sass"><code>index ( $string, $substring [, $start-at] )</code></a></dt>
  <dd>Returns the first index at which a specified substring can be found in a string; otherwise, 0 is returned, indicating the substring is not present.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_last-index.sass"><code>last-index ( $string, $substring [, $end-at] )</code></a></dt>
  <dd>Returns the last index at which a specified substring can be found in a string; otherwise, 0 is returned, indicating the substring is not present. The string is searched forwards, ending at a given index when specified.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_split.sass"><code>split ( $string [, $delimiter] [, $limit] [, $separator] [, $bracketed] )</code></a></dt>
  <dd>Divides a string into a list of substrings.</dd>

  <dt><a href="//github.com/roydukkey/sass-module-string/tree/master/src/string/_starts-with.sass"><code>starts-with ( $string, $substring [, $start-at] )</code></a></dt>
  <dd>Determines whether a string begins with the characters of a specified substring, returning true or false as appropriate.</dd>

</dl>

Don't see the function you're looking for? Request a [new feature](//github.com/roydukkey/sass-module-string/issues/new) describing a use case.

## Combined API

In order to avoid constantly declaring both the native 'sass:string' module and this library, the combined API has been added which merges the two.

```scss
// Rather than using both modules separately...
@use 'sass-string';
@use 'sass:string';

// ...this statement will accomplish the same thing.
@use 'sass-string/string';
```

*Note:* Since its functionality is enhanced by this library, the combined API hides the native `string.index()` function.

---
_Source: https://npm.io/package/sass-string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
