replace method

replace

Replaces an existing token with a new token. Does nothing if the first token doesn’t exist.

Returns

Boolean true if the token was found and replaced, false otherwise.

def replace(self, token, new_token):
    ...
ParameterTypeDescription
tokenstrThe token you want to replace.
new_tokenstrThe token you want to replace the old token with.

See Also