cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
struggling at using erase()
struggling at using erase()
Mar 20, 2020 at 2:07am UTC
tomato1904
(4)
-
Last edited on
Mar 25, 2020 at 3:22am UTC
Mar 20, 2020 at 2:11am UTC
highwayman
(578)
erase() is going to get rid of a letter, yes? So when you find a letter in the string that isVowel(), then you just erase() it from the string and once you’ve searched the entire string, you just return the string.
Mar 20, 2020 at 2:12am UTC
highwayman
(578)
Also here’s some documentation on erase()
http://cplusplus.com/reference/string/string/erase/
Mar 20, 2020 at 2:57am UTC
tomato1904
(4)
so... like this?
1
2
3
4
5
6
string removeVowels(
const
string& input) { string input; erase(isVowel(input)) }
Mar 20, 2020 at 3:41am UTC
ne555
(10692)
no, not like that
at least respect the prototypes
let's simplify
make a function that says (output to screen) for each character of a string, if it is or not a vowel.
Topic archived. No new replies allowed.