urlEncode

Replaces all characters with the appropriate UTF-8 escape sequences.

Install

Install all functions of strman

yarn add strman

or just the urlEncode function

yarn add strman.urlencode

Usage

import { urlEncode } from 'strman'
// OR
import urlEncode from 'strman.urlencode'
Parameters:
Name Type Description
value String

The string to be encoded

Source:
Returns:

Returns a string in which all non-alphanumeric characters except -_.

Type
String
Example
urlEncode('https://github.com/dleitee/strman/&name=áéíóú')
// => 'https://github.com/dleitee/strman/&name=%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA'