+ 2

how to set all the spaces in a string to @ or any other character

13th Apr 2017, 2:46 PM
AISHWARY SINGH CHAUHAN
AISHWARY SINGH CHAUHAN - avatar
2 odpowiedzi
+ 4
Set all the spaces in a string to @, visit: https://code.sololearn.com/cj9oWmRA82Jj/?ref=app
13th Apr 2017, 3:35 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 4
create a for loop. Example below. #include <iostream> #include <string> using namespace std; int main() { string password = "helloworld"; for(unsigned int i = 0; i < password.length(); i++) { password[i] = '@'; } return 0; }
13th Apr 2017, 5:29 PM
Joshua Pierson
Joshua Pierson - avatar