diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 02cd66e299..d48d56d522 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -1387,6 +1387,10 @@ String String::replaceCharacter (const juce_wchar charToReplace, const juce_wcha String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const { + // Each character in the first string must have a matching one in the + // second, so the two strings must be the same length. + jassert (charactersToReplace.length() == charactersToInsertInstead.length()); + StringCreationHelper builder (text); for (;;)