# String With Indexed Replacement

Grammarstring with characters from start to end replaced by replaceString
FlagsNative | Function

Replaces all characters that exist between two other characters in the string.

# Arguments

  • string — String
  • string — Replace String
  • int — Start
  • int — End

Returns — string

native string StringReplace(
	string s,
	string replace,
	int start,
	int end,
);

Category: String / Substrings

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:7987

        lv_newState = "0";
    }
    libCamp_gf_SetStoryModeRoomStates(StringReplace(lv_states, lv_newState, lv_index, lv_index));
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:7987

        lv_newState = "0";
    }
    libCamp_gf_SetStoryModeRoomStates(StringReplace(lv_states, lv_newState, lv_index, lv_index));
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:4032

    lv_length = StringLength(lv_name);
    lv_subLength = StringLength(lv_subName);
    lv_name = StringReplace(lv_name, lv_subName, (lv_length-lv_subLength+1), lv_length);
    return lv_name;
}