translate_string()

translate_string()#

Translate all occurrences of a specified character in a string to another character.

Prototype

PUBLIC char *translate_string(
    char        *string,
    char         from,
    char         to
);
        

Parameters

Key

Type

Description

string

char *

The string to modify.

from

char

The character to replace.

to

char

The character to replace it with.


Return Value

Returns the modified string with characters replaced.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples