# eden-string

> Eden Node JS String Methods

Latest version **0.0.33** (published 2015-08-07) · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.33 |
| Published | 2015-08-07 |
| First published | 2014-09-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Christian Blanquera |
| Maintainers | cblanquera |
| Keywords | eden, library |

## Links

- npm: https://www.npmjs.com/package/eden-string
- Repository: https://github.com/edenjs/string
- Issues: https://github.com/edenjs/string/issues
- npm.io page: https://npm.io/package/eden-string

## Dependencies (1)

- [eden-class](https://npm.io/package/eden-class.md) 0.0.32

## Recent versions

- 0.0.33 (latest) — 2015-08-07
- 0.0.32 — 2015-05-20
- 0.0.31 — 2014-11-28
- 0.0.28 — 2014-11-11
- 0.0.27 — 2014-11-11
- 0.0.26 — 2014-11-07
- 0.0.25 — 2014-11-06
- 0.0.24 — 2014-11-03
- 0.0.23 — 2014-10-17
- 0.0.21 — 2014-10-13
- 0.0.20 — 2014-10-08
- 0.0.19 — 2014-10-08
- 0.0.18 — 2014-10-08
- 0.0.17 — 2014-10-02
- 0.0.16 — 2014-10-02
- … 12 more at https://npm.io/package/eden-string/versions

## README

#String

DESCRIPTION

[![Build Status](https://api.travis-ci.org/edenjs/string.png)](https://travis-ci.org/edenjs/string)

## General

### Installation

```
npm install eden-string
```

### Usage

```
var string = require('eden-string');
```

## Methods

  * [addSlashes](#addSlashes)

  * [base64Decode](#base64Decode)

  * [base64Encode](#base64Encode)

  * [camelize](#camelize)

  * [charAt](#charAt)

  * [charCodeAt](#charCodeAt)

  * [concat](#concat)

  * [dasherize](#dasherize)

  * [endsWith](#endsWith)

  * [equals](#equals)

  * [has](#has)

  * [hashToQuery](#hashToQuery)

  * [hmac](#hmac)

  * [htmlEntities](#htmlEntities)

  * [htmlEntityDecode](#htmlEntityDecode)

  * [indexOf](#indexOf)

  * [isJson](#isJson)

  * [isString](#isString)

  * [isEmpty](#isEmpty)

  * [jsonToHash](#jsonToHash)

  * [lastIndexOf](#lastIndexOf)

  * [lcFirst](#lcFirst)

  * [nl2br](#nl2br)

  * [match](#match)

  * [md5](#md5)

  * [pathToArray](#pathToArray)

  * [pathToQuery](#pathToQuery)

  * [queryToHash](#queryToHash)

  * [replace](#replace)

  * [startsWith](#startsWith)

  * [search](#search)

  * [sha1](#sha1)

  * [size](#size)

  * [slice](#slice)

  * [split](#split)

  * [stripSlashes](#stripSlashes)

  * [substr](#substr)

  * [substring](#substring)

  * [stripTags](#stripTags)

  * [summarize](#summarize)

  * [titlize](#titlize)

  * [toLowerCase](#toLowerCase)

  * [toHash](#toHash)

  * [toPath](#toPath)

  * [toUpperCase](#toUpperCase)

  * [trim](#trim)

  * [ucFirst](#ucFirst)

  * [ucWords](#ucWords)

  * [uid](#uid)

  * [uncamelize](#uncamelize)

  * [urlDecode](#urlDecode)

  * [urlEncode](#urlEncode)

  * [utf8Encode](#utf8Encode)

  * [uuid](#uuid)

---

<a name="addSlashes"></a>

### addSlashes

```
 string addSlashes('I can't wait.');
```

Returns a string with backslashes before characters that need to be escaped.

#### Parameters

  1. 'I can't wait.' - string with apostrophe(')

#### Returns

 string

#### Example

##### Code

```
string().addSlashes('I can't wait.');
```

##### Outputs

```
'I can\\'t wait.'
```

---

<a name="base64Decode"></a>

### base64Decode

```
 string base64Decode('dGVzdA==');
```

Decodes a base 64 string

#### Parameters

  1. 'dGVzdA==' - encoded base 64 string

#### Returns

 string

#### Example

##### Code

```
string().base64Decode('dGVzdA==');
```

##### Outputs

```
'test'
```

---

<a name="base64Encode"></a>

### base64Encode

```
 string base64Encode('test');
```

Encodes a base 64 string

#### Parameters

  1. 'test' - convert to base 64 string 

#### Returns

 string

#### Example

##### Code

```
string().base64Encode('test');
```

##### Outputs

```
'dGVzdA=='
```

---

<a name="camelize"></a>

### camelize

```
 string camelize('this-is-sparta', sparta);
```

Camelizes a string

#### Parameters

  1. 'this-is-sparta' - string with a dash (-) in between

  2. sparta - string (prefix)

#### Returns

 string

#### Example

##### Code

```
string().camelize('this-is-sparta','sparta');
string().camelize('this-is-sparta');
```

##### Outputs

```
'this-Is-'
'thisIsSparta'
```

---

<a name="charAt"></a>

### charAt

```
 string charAt('You cant find me', 7);
```

Returns the character at the specified index

#### Parameters

  1. 'You cant find me' - string 

  2. 7 - number (specified index)

#### Returns

 string

#### Example

##### Code

```
string().charAt('You cant find me', 7);
```

##### Outputs

```
't'
```

---

<a name="charCodeAt"></a>

### charCodeAt

```
 string charCodeAt('You cant find me', 7);
```

Returns the Unicode of the character at the specified index

#### Parameters

  1. 'You cant find me' - string 

  2. 7 - number (specified index)

#### Returns

 string

#### Example

##### Code

```
string().charCodeAt('You cant find me', 7);
```

##### Outputs

```
116
```

---

<a name="concat"></a>

### concat

```
 string concat('You cant find me', 'Yes I can');
```

Joins two or more strings

#### Parameters

  1. 'You cant find me', 'Yes I can' - 2 or more strings, separated by comma (,)

#### Returns

 string

#### Example

##### Code

```
string().concat('You cant find me', 'Yes I can');
```

##### Outputs

```
'You cant find meYes I can'
```

---

<a name="dasherize"></a>

### dasherize

```
 string dasherize('This Is Sparta');
```

Transforms a string with caps and space to a lower case dash string

#### Parameters

  1. 'This Is Sparta' - string to be transform with caps and space to a lower case dash string

#### Returns

 string

#### Example

##### Code

```
string().dasherize('This Is Sparta');
```

##### Outputs

```
'this-is-sparta'
```

---

<a name="endsWith"></a>

### endsWith

```
 bool endsWith('To be or not to be that is the question', 'question');
```

Returns true if string ends with given value

#### Parameters

  1. 'To be or not to be that is the question' - string

  2. 'question' - end word of the string that is the same with the given value

#### Returns

 bool

#### Example

##### Code

```
string().endsWith('To be or not to be that is the question', 'question');
```

##### Outputs

```
true
```

---

<a name="equals"></a>

### equals

```
 bool equals('brown fox', 'brown fox', true);
```

Returns true if given value equals string

#### Parameters

  1. 'brown fox' - string

  2. 'brown fox' - mixed (same string as the first parameter)

  3. true - bool (strict mode)

#### Returns

 bool

#### Example

##### Code

```
string().equals('brown fox', 'brown fox', true);
```

##### Outputs

```
true
```

---

<a name="has"></a>

### has

```
 bool has('thisIsSparta', 'isIs');
```

Returns true if specified value is found within the string

#### Parameters

  1. 'thisIsSparta' - string (with or without whitespace)

  2. 'isIs' - string (string within the string)

#### Returns

 bool

#### Example

##### Code

```
string().has('thisIsSparta', 'isIs');
string().has('this is sparta', 's spa');
string().has('this is sparta', 'issparta');
```

##### Outputs

```
true
true
false
```

---

<a name="hashToQuery"></a>

### hashToQuery

```
 string hashToQuery({test2:6});
```

Returns query string from the given object

#### Parameters

  1. {test2:6} - any kind of object

#### Returns

 string

#### Example

##### Code

```
string().hashToQuery({test2:6});
string().hashToQuery({test3:9});
```

##### Outputs

```
'test2=6'
'test3=9'
```

---

<a name="hmac"></a>

### hmac

```
 string hmac('test', '1234', sha1', 'hex');
```

hmac encryption

#### Parameters

  1. 'test' - string

  2. '1234' - string

  3. 'sha1' - string (sha1|md5|sha256)

  4. 'hex' - string (binary|hex|base64)

#### Returns

 string

#### Example

##### Code

```
string().hmac('test', '1234', 'sha1', 'hex');
```

##### Outputs

```
'6455fdb217cfe086953a844dabac0491b05d91d2'
```

---

<a name="htmlEntities"></a>

### htmlEntities

```
 string htmlEntities(Number, String, String);
```

Convert all applicable characters to HTML entities

#### Parameters

  1. number

  2. string

  3. string

#### Returns

 string

#### Example

##### Code

```
string().htmlEntities('4 > 6 & 5');
```

##### Outputs

```
'4 &lt; 6 &amp; 5'
```

---

<a name="htmlEntityDecode"></a>

### htmlEntityDecode

```
 string htmlEntityDecode(String, Number);
```

Convert all HTML entities to their applicable characters

#### Parameters

  1. string

  2. number

#### Returns

 string

#### Example

##### Code

```
string().htmlEntityDecode('4 &lt; 6 &amp; 5');
```

##### Outputs

```
'4 < 6 & 5'
```

---

<a name="indexOf"></a>

### indexOf

```
 number indexOf('You cant find me', 't');
```

Returns the position of the first found occurrence of a specified value in a string

#### Parameters

  1. 'You cant find me' - string 

  2. 't' - string (specified value in a string)
#### Returns

 number

#### Example

##### Code

```
string().indexOf('You cant find me', 't');
string().indexOf('You cant find me', 'in');
```

##### Outputs

```
7
10
```

---

<a name="isJson"></a>

### isJson

```
 bool isJson('{"test1":4}');
```

Returns true if string is JSON formatted

#### Parameters

  1. '{"test1":4}' - string (string in JSON format)

#### Returns

 bool

#### Example

##### Code

```
string().isJson('{"test1":4}');
string().isJson('{test1:4}');
```

##### Outputs

```
true
false
```

---

<a name="isString"></a>

### isString

```
 bool isString('I got you');
```

Returns true if given is a string

#### Parameters

  1. 'I got you' - mixed (2 or more strings / strings with numbers)

#### Returns

 bool

#### Example

##### Code

```
string().isString('I got you');
string().isString('Hello 1234');
```

##### Outputs

```
true
true
```

---

<a name="isEmpty"></a>

### isEmpty

```
 bool isEmpty('');
```

Returns true if string is empty

#### Parameters

  1. ' ' - string (checks if the string is empty)

#### Returns

 bool

#### Example

##### Code

```
string().isEmpty("");
string().isEmpty('Hi');
```

##### Outputs

```
true
false
```

---

<a name="jsonToHash"></a>

### jsonToHash

```
 object jsonToHash(String);
```

Converts a JSON string to an object

#### Parameters

  1. string

#### Returns

 object

#### Example

##### Code

```
string().jsonToHash('{"test1":4}').test1);
```

##### Outputs

```
4
```

---

<a name="lastIndexOf"></a>

### lastIndexOf

```
 number lastIndexOf('You cant find me', 'n');
```

Returns the position of the last found occurrence of a specified value in a string

#### Parameters

  1. 'You cant find me' - string

  2. 'n' - string (specified value to find the last occurrence)

#### Returns

 number

#### Example

##### Code

```
string().lastIndexOf('You cant find me', 'n');
string().lastIndexOf('I got you', 'you');
```

##### Outputs

```
11
6
```

---

<a name="lcFirst"></a>

### lcFirst

```
 string lcFirst('THIS IS SPARTA');
```

Lowercase the first letter of the string

#### Parameters

  1. 'THIS IS SPARTA' - string (string must be all in uppercase)

#### Returns

 string

#### Example

##### Code

```
string().lcFirst('THIS IS SPARTA');
```

##### Outputs

```
'tHIS IS SPARTA'
```

---

<a name="nl2br"></a>

### nl2br

```
 string nl2br('THIS\nIS\nSPARTA');
```

Inserts HTML line breaks before all newlines in a string

#### Parameters

  1. 'THIS\nIS\nSPARTA' - string (place (\n) between the given string)

#### Returns

 string

#### Example

##### Code

```
string().nl2br('THIS\nIS\nSPARTA');
```

##### Outputs

```
'THIS<br />IS<br />SPARTA'
```

---

<a name="match"></a>

### match

```
 array match('The rain in SPAIN stays mainly in the plain', /ain/g);
```

Searches for a match between a regular expression and a string, and returns the matches

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - string

  2. /ain/g - RegExp (global searching for a match with string)

#### Returns

 array

#### Example

##### Code

```
string().match('The rain in SPAIN stays mainly in the plain', /ain/g);
```

##### Outputs

```
'ain,ain,ain'
```

---

<a name="md5"></a>

### md5

```
 string md5('test');
```

Calculate the md5 hash of a string

#### Parameters

  1. 'test' - any string to be calculated to md5 hash

#### Returns

 string

#### Example

##### Code

```
string().md5('test');
```

##### Outputs

```
'098f6bcd4621d373cade4e832627b4f6'
```

---

<a name="pathToArray"></a>

### pathToArray

```
 string pathToArray('/some/path/to/file');
```

Converts a path into an array

#### Parameters

  1. '/some/path/to/file' - string (path)

#### Returns

 string

#### Example

##### Code

```
string().pathToArray('/some/path/to/file');
string().pathtoArray('/some/path/to/file').length);
```

##### Outputs

```
['some','path','to','file']
4
```

---

<a name="pathToQuery"></a>

### pathToQuery

```
 object pathToQuery('/some/path/to/file?test1=4');
```

Formats a path with query to an object

#### Parameters

  1. '/some/path/to/file?test1=4' - string (path)

#### Returns

 object

#### Example

##### Code

```
string().pathToQuery('/some/path/to/file?test1=4');
string().pathToQuery('/some/path/to/file?test1=4').test1);
```

##### Outputs

```
{'test1':4}
4
```

---

<a name="queryToHash"></a>

### queryToHash

```
 object queryToHash('test1=4&test2=6');
```

Converts a query string to an object

#### Parameters

  1. 'test1=4&test2=6' - any string to be converted as query(object)

#### Returns

 object

#### Example

##### Code

```
string().queryToHash('test1=4&test2=6');
string().queryToHash('test1=4&test2=6').test2);
```

##### Outputs

```
{'test1':4,'test2':6}
6
```

---

<a name="replace"></a>

### replace

```
 string replace('This is Sparta', 'i', 'a');
```

Searches for a match between a substring (or regular expression) and a string, and replaces the matched substring with a new substring

#### Parameters

  1. 'This is Sparta' - string

  2. 'i', 'a' - string|RegExp (search for a match between a substring an a string, replaces the  matched substring with a new substring)

#### Returns

 string

#### Example

##### Code

```
string().replace('This is Sparta', 'i', 'a');
```

##### Outputs

```
'Thas as Sparta'
```

---

<a name="startsWith"></a>

### startsWith

```
 bool startsWith('Hello', 'He');
```

Returns true if string starts with given value

#### Parameters

  1. 'Hello' - string

  2. 'He' - string (same starting value with given value)

#### Returns

 bool

#### Example

##### Code

```
string().startsWith('Hello', 'He');
```

##### Outputs

```
true
```

---

<a name="search"></a>

### search

```
 number search('You cant find me', 't');
```

Searches for a match between a regular expression and a string, and returns the position of the match

#### Parameters

  1. 'You cant find me' - string

  2.  't' - string|RegExp (specified character or a regular expression)

#### Returns

 number

#### Example

##### Code

```
string().search('You cant find me', 't');
```

##### Outputs

```
7
```

---

<a name="sha1"></a>

### sha1

```
 string sha1('test');
```

Calculate the sha1 hash of a string

#### Parameters

  1. 'test' - string to be calculated to sha1 hash

#### Returns

 string

#### Example

##### Code

```
string().sha1('test');
```

##### Outputs

```
'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'
```

---

<a name="size"></a>

### size

```
 number size('qwert');
```

Returns the size of the string

#### Parameters

  1. 'qwert' - string

#### Returns

 number

#### Example

##### Code

```
string().size('qwert');
```

##### Outputs

```
5
```

---

<a name="slice"></a>

### slice

```
 string slice('The rain in SPAIN stays mainly in the plain', 10, 15);
```

Extracts a part of a string and returns a new string

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - string

  2. 10 - number (specified start position)

  3. 15 - [number](specified end position)

#### Returns

 string

#### Example

##### Code

```
string().slice('The rain in SPAIN stays mainly in the plain', 10, 15);
```

##### Outputs

```
'n SPA'
```

---

<a name="split"></a>

### split

```
 array split('The rain in SPAIN stays mainly in the plain', 'ain');
```

Splits a string into an array of substrings

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - any string to be splited into an array of substrings

  2. 'ain' - string

#### Returns

 array

#### Example

##### Code

```
string().split('The rain in SPAIN stays mainly in the plain', 'ain');
string().split('The rain in SPAIN stays mainly in the plain', 'ain').length);
```

##### Outputs

```
['The r', 'in SPAIN stays m', 'ly in the pl','']
4
```

---

<a name="stripSlashes"></a>

### stripSlashes

```
 string stripSlashes('I can\\'t wait');
```

Returns a string with backslashes stripped off.

#### Parameters

  1. 'I can\\'t wait' - string (string with backlashes before an apostrophe('))

#### Returns

 string

#### Example

##### Code

```
string().stripSlashes('I can\\'t wait');
```

##### Outputs

```
'I can't wait'
```

---

<a name="substr"></a>

### substr

```
 string substr('The rain in SPAIN stays mainly in the plain', 10, 5);
```

Extracts the characters from a string, beginning at a specified start position, and through the specified number of character

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - any string to be extract 

  2. 10 - number (specified starting position)

  3. 5 - number (specified number of character to be extracted)

#### Returns

 string

#### Example

##### Code

```
string().substr('The rain in SPAIN stays mainly in the plain', 10, 5);
```

##### Outputs

```
'n SPA'
```

---

<a name="substring"></a>

### substring

```
 string substring('The rain in SPAIN stays mainly in the plain', 10, 15);
```

Extracts the characters from a string, between two specified indices

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - string

  2. 10 - number (specified index)

  3. 5 - number (specified index)

#### Returns

 string

#### Example

##### Code

```
string().substring('The rain in SPAIN stays mainly in the plain', 10, 15);
```

##### Outputs

```
'n SPA'
```

---

<a name="stripTags"></a>

### stripTags

```
 string stripTags(String, String);
```

Strips HTML out of string

#### Parameters

  1. string

  2. string

#### Returns

 string

#### Example

##### Code

```
string().stripTags("THIS<br />IS<br />SPARTA");
```

##### Outputs

```
'THISISSPARTA'
```

---

<a name="summarize"></a>

### summarize

```
 string summarize('The rain in SPAIN stays mainly in the plain',4);
```

Summarizes a text

#### Parameters

  1. 'The rain in SPAIN stays mainly in the plain' - string

  2.  4 - int (number of words)

#### Returns

 string

#### Example

##### Code

```
string().summarize('The rain in SPAIN stays mainly in the plain', 4);
```

##### Outputs

```
'The rain in SPAIN'
```

---

<a name="titlize"></a>

### titlize

```
 string titlize(String, String);
```

Titlizes a string

#### Parameters

  1. string

  2. string - prefix

#### Returns

 string

#### Example

##### Code

```
string().titlize('this-is-sparta');
```

##### Outputs

```
'This Is Sparta'
```

---

<a name="toLowerCase"></a>

### toLowerCase

```
 string toLowerCase('This Is Sparta');
```

Converts a string to lowercase letters

#### Parameters

  1. 'This Is Sparta' - any string to be converted to lowercase letters

#### Returns

 string

#### Example

##### Code

```
string().toLowerCase('This Is Sparta');
```

##### Outputs

```
'this is sparta'
```

---

<a name="toHash"></a>

### toHash

```
 object toHash('test1=4&test2=6');
```

Converts either a JSON string or a query string to an object

#### Parameters

  1. 'test1=4&test2=6' - any string to be converted either a JSON string or a query string to an object

#### Returns

 object

#### Example

##### Code

```
string().toHash('test1=4&test2=6');
string().toHash('{"test1":4}');
string().toHash('test1=4&test2=6').test2);
string().toHash('{"test1":4}').test1);
```

##### Outputs

```
{'test1':4,'test2':6}
{'test1':4}
6
4
```

---

<a name="toPath"></a>

### toPath

```
 string toPath('some/path//to/file/';
```

Formats a string into a proper path

#### Parameters

  1. 'some/path//to/file/' - string (path)

#### Returns

 string

#### Example

##### Code

```
string().toPath('some/path//to/file/');
```

##### Outputs

```
'/some/path/to/file'
```

---

<a name="toUpperCase"></a>

### toUpperCase

```
 string toUpperCase('This Is Sparta');
```

Converts a string to uppercase letters

#### Parameters

  1. 'This Is Sparta' - string to be converted to uppercase letters

#### Returns

 string

#### Example

##### Code

```
string().toUpperCase('This Is Sparta');
```

##### Outputs

```
'THIS IS SPARTA'
```

---

<a name="trim"></a>

### trim

```
 string trim('   This Is Sparta  ');
```

Removes whitespace from both ends of a string

#### Parameters

  1. '   This Is Sparta  ' - string (string with whitespaces from both ends)

#### Returns

 string

#### Example

##### Code

```
string().trim('   This Is Sparta  ');
```

##### Outputs

```
'This Is Sparta'
```

---

<a name="ucFirst"></a>

### ucFirst

```
 string ucFirst('this is sparta');
```

Capitalize the first letter of the string

#### Parameters

  1. 'this is sparta' - string (the first letter to be capitalized)

#### Returns

 string

#### Example

##### Code

```
string().ucFirst('this is sparta');
```

##### Outputs

```
'This is sparta'
```

---

<a name="ucWords"></a>

### ucWords

```
 string ucWords('this is sparta');
```

Uppercase the first character of each word in a string

#### Parameters

  1. 'this is sparta' - string (first character of each word in a string is to be uppercase)

#### Returns

 string

#### Example

##### Code

```
string().ucWords('this is sparta');
```

##### Outputs

```
'This Is Sparta'
```

---

<a name="uid"></a>

### uid

```
 string uid('test');
```

Returns a base 51 unique id

#### Parameters

  1. string

#### Returns

 string

#### Example

##### Code

```
string().uid('test');
```

##### Outputs

```
'aZblbFaobzaQabwibhae'
```

---

<a name="uncamelize"></a>

### uncamelize

```
 string uncamelize('this Is Sparta', 'helloworld');
```

Uncamelizes a string

#### Parameters

  1. 'this Is Sparta'- string

  2. 'helloworl - string (prefix)

#### Returns

 string

#### Example

##### Code

```
string().uncamelize('thisIsSparta');
```

##### Outputs

```
'this helloworldis helloworldsparta'
```

---

<a name="urlDecode"></a>

### urlDecode

```
 string urlDecode('my%20test.asp?name=st%C3%A5le&car=saab');
```

Decodes URI version

#### Parameters

  1. 'my%20test.asp?name=st%C3%A5le&car=saab' - string (to be decoded as URI version)

#### Returns

 string

#### Example

##### Code

```
string().urlDecode('my%20test.asp?name=st%C3%A5le&car=saab');
```

##### Outputs

```
'my test.asp?name=ståle&car=saab'
```

---

<a name="urlEncode"></a>

### urlEncode

```
 string urlEncode('my test.asp?name=ståle&car=saab');
```

Returns the encoded URI version

#### Parameters

  1. 'my test.asp?name=ståle&car=saab' - string (to be encoded as URI version)

#### Returns

 string

#### Example

##### Code

```
string().urlEncode('my test.asp?name=ståle&car=saab');
```

##### Outputs

```
'my%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab'
```

---

<a name="utf8Encode"></a>

### utf8Encode

```
 string utf8Encode('Kevin van Zonneveld');
```

Encodes an ISO-8859-1 string to UTF-8

#### Parameters

  1. 'Kevin van Zonneveld' - string to be encoded to UTF-8

#### Returns

 string

#### Example

##### Code

```
string().utf8Encode('Kevin van Zonneveld');
```

##### Outputs

```
'Kevin van Zonneveld'
```

---

<a name="uuid"></a>

### uuid

```
 string uuid('test');
```

Generates a version 4 or 5 UUID.

#### Parameters

  1. 'test' - mixed (to be generated to version 4 or 5 UUID)

#### Returns

 string

#### Example

##### Code

```
string().uuid('test');
```

##### Outputs

```
'a94a8fe5-ccb1-5ba6-9c4c-0873d391e987'
```

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