Remove Specific Character From String API

This API provides a convenient way to remove specific characters from a given string. It offers a set of functions or methods that allow developers to interact with the API and perform character removal operations on strings programmatically.

URL: https://api.apipip.com/v1/remove-character-from-string


Parameters

Name Description
input_string (Required) (string): The input string from which characters need to be removed. This parameter represents the original string that will be processed.
characters_to_remove (Required) (string): The characters that need to be removed from the input string. This parameter specifies the characters or symbols that should be eliminated from the input string.

Headers

Name Description
X-Key (No required)

How to use Remove Specific Character From String API

                
import requests

# API endpoint URL
url = 'https://api.apipip.com/v1/remove-character-from-string'

# Request payload
payload = {
    'input_string': 'Hello, World!',
    'characters_to_remove': ',!'
}

# Send POST request to the API
response = requests.post(url, json=payload)

# Check if the request was successful
if response.status_code == 200:
    # Extract the output_string from the response JSON
    output_string = response.json().get('output_string')
    print('Output String:', output_string)
else:
    print('Error:', response.text)
                
                    
                
const axios = require('axios');

// API endpoint URL
const url = 'https://api.apipip.com/v1/remove-character-from-string';

// Request payload
const payload = {
  input_string: 'Hello, World!',
  characters_to_remove: ',!'
};

// Send POST request to the API
axios.post(url, payload)
  .then(response => {
    // Extract the output_string from the response data
    const outputString = response.data.output_string;
    console.log('Output String:', outputString);
  })
  .catch(error => {
    console.error('Error:', error.message);
  });
                
                    
                
import Foundation

// API endpoint URL
let url = URL(string: "https://api.apipip.com/v1/remove-character-from-string")!

// Request payload
let payload: [String: Any] = [
    "input_string": "Hello, World!",
    "characters_to_remove": ",!"
]

// Convert payload to JSON data
let jsonData = try! JSONSerialization.data(withJSONObject: payload)

// Create the request
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = jsonData
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

// Send the request
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
    if let error = error {
        print("Error:", error.localizedDescription)
    } else if let data = data,
              let json = try? JSONSerialization.jsonObject(with: data, options: []),
              let responseDict = json as? [String: Any],
              let outputString = responseDict["output_string"] as? String {
        print("Output String:", outputString)
    } else {
        print("Invalid response")
    }
}
task.resume()
                
                    

API Response

                            
{
  "output_string": "Hello World"
}
                            
                                

Note: The API works with all programming languages