Sample code for 30+ languages & platforms
React Native

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat React Native Downloads

React Native
import { Http } from '@chilkat/react-native'

function chilkatExample() {
  const http = new Http();

  const s = 'Hello World! 100% sure.';

  const encoded = http.urlEncode(s);
  console.log(`URL encoded: ${encoded}`);

  // Space → %20
  // ! → %21
  // % → %25

  const decoded = http.urlDecode(encoded);
  console.log(`URL decoded: ${decoded}`);

  // Output:

  // URL encoded: Hello%20World%21%20100%25%20sure.
  // URL decoded: Hello World! 100% sure.
}