1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a helpful assertion in String::replaceCharacters

This commit is contained in:
jules 2016-03-02 10:11:57 +00:00
parent 9d266d1184
commit f99b49c999

View file

@ -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 (;;)