-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove vowels.cpp
32 lines (25 loc) · 915 Bytes
/
remove vowels.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
string removeVow(string s){
for (int i=0; i<s.length(); i++){
if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u' ||
s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' || s[i] == 'U')
{
s = s.substr(0, i) + s.substr(i+1);
i--;
}
}
return s;
}
int main()
{
string s1= "lets go from hara";
cout<<removeVow(s1);
return 0;
}