+ 5

Program to replace every spaces in a string with hypen

22nd Feb 2018, 3:35 PM
ⓢⓐⓝⓓⓔⓔⓟ
ⓢⓐⓝⓓⓔⓔⓟ - avatar
2 Answers
+ 3
https://code.sololearn.com/cqq9BeGF86Qm/#cpp #include <iostream> #include <algorithm> #include <string> using namespace std; int main() { string myString = "This is a string."; replace(myString.begin(), myString.end(), ' ', '-'); cout << myString; return 0; } :::: OUTPUT :::: This-is-a-string.
22nd Feb 2018, 3:49 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
plzz...help...to solve this question
22nd Feb 2018, 3:35 PM
ⓢⓐⓝⓓⓔⓔⓟ
ⓢⓐⓝⓓⓔⓔⓟ - avatar