Browse Source

Added a helpful assertion in String::replaceCharacters

tags/2021-05-28
jules 9 years ago
parent
commit
f99b49c999
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      modules/juce_core/text/juce_String.cpp

+ 4
- 0
modules/juce_core/text/juce_String.cpp 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 (;;)


Loading…
Cancel
Save