Computers and Technology, 30.10.2021 22:20, emrecaga1992
Write a program that removes all non-alphabetic characters from the given input.
Ex: If the input is:
-Hello, 1 world$!
the output is:
Helloworld
Your program must define and call the following function. The function should return a string representing the input string without non-alphabetic characters.
string RemoveNonAlpha(string userString)
#include
#include
#include
using namespace std;
/* Define your function here */
string RemoveNonAlpha(string userString)
{
char ch;
string str;
int length;
length = userString. length();
for (int i = 0; i <= length; i++)
{
ch = userString;
if (isalpha(ch))
{
str += ch;
}
}
return str;
}
int main()
{
// Local Variables
string input;
getline(cin, input);
cout << RemoveNonAlpha(input) << endl;
return 0;
}
my code is wrong but I can't seem to figure out the problem becuase i am getting no output
Answers: 1
Computers and Technology, 23.06.2019 14:30, Vanesssajohn2962
Norder to receive financial aid at his vocational school, mario must fill out the fafsa. the fafsa is a form that must be completed to determine . in order to complete a fafsa, you must submit . the fafsa can students obtain
Answers: 2
Computers and Technology, 24.06.2019 12:00, elainnysanchez1541
How can we take picture in this app
Answers: 1
Write a program that removes all non-alphabetic characters from the given input.
Ex: If the input...
Biology, 07.08.2019 01:30
Mathematics, 07.08.2019 01:30