WWW.EscapeURL Manual     Reference     Scripting  
Scripting > Runtime Classes > WWW
WWW.EscapeURL

static function EscapeURL (s : string, e : Encoding = System.Text.Encoding.UTF8) : string

Parameters

NameDescription
s A string to be escaped.
e The encoding to use when converting characters to a character code.

Returns

string - A new string with all illegal characters replaced with %xx where xx is the hexadecimal code for the character code.

Description

Encodes string into an URL-friendly format.

Replaces illegal characters in s with the correct URL escaped code. Useful when building web page parameters.

See Also: WWW.UnEscapeURL.

JavaScripts
// This will print the string "Testing%201%2C2%2C3" to the console
print(WWW.EscapeURL("Testing 1,2,3"));

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
print(WWW.EscapeURL("Testing 1,2,3"));
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
print(WWW.EscapeURL('Testing 1,2,3'))