0

I'm trying to replace "\n" with "\n" but I'm not allowed to do it with this function:

std::replace(encryptedKey.begin(), encryptedKey.end(), "\n", "\\n"); 

encryptedKey is a long string.

I think I get the error because I'm trying to replace with more characters, is there any other solutions for doing this in a string?

Edit 1:

Error : Severity Code Description Project File Line Suppression State Error (active) E0304 no instance of function template "std::replace" matches the argument list encryption c:\Users\heltbork\source\repos\encryption\encryption\encryption.cpp 274

6
  • What you are trying to achieve with that replacement? Commented Mar 15, 2018 at 14:46
  • what error do you get? Commented Mar 15, 2018 at 14:46
  • You should recheck how replace works. Your going to need the find function to help you with this. Commented Mar 15, 2018 at 14:46
  • check this question: stackoverflow.com/questions/4643512/… Commented Mar 15, 2018 at 14:48
  • Error (active) E0304 no instance of function template "std::replace" matches the argument list encryption Commented Mar 15, 2018 at 15:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.