# ReplaceString

## Description

Returns a string with all instances of "find" replaced with "replace". You can use the qty parameter to limit the number of replacements made, or use -1 for no limit. The original string is unmodified and a new string is returned with the replacements in it. Note that if you are calling this command from tier 2 then the returned string must be deleted when you are done with it.

## Definition

string ReplaceString( str, find, replace, qty )

char* agk::ReplaceString( const char* str, const char* find, const char* replace, int qty )

## Parameters

- str - The string to modify
- find - The string to find
- replace - The string to replace it with
- qty - The maximum number of replacements to make, use minus 1 for no limit