validate strings
Last edited on
1 2 3 4 5 6
|
string a;
const char valid_letters[] = "acgt";
cout<<"Enter DNA Sequence" <<endl;
cin >> a;
if ( a.find_first_not_of( valid_letters ) == std::string::npos ) DNA.push_back(a);
|
}
Last edited on
i don't really understand that, and it appears not to work.
I do not really understand what means "it appears not to work".
i mean i do what you did and it did not work correctly
I am sure that you did not do what I showed. As the result your code works incorrectly.
The problem is that you do not understand what you are doing.