How to remove [^a-z\s] in C++
- by Steven
So far I have:
int SimplifyText(char chars[], int length)
{
//To lower
for(int i=0; i<length; i++)
{
chars[i] = tolower(chars[i]);
}
This function simplifies the text in the first argument which is an array containing the number of characters as given in the second argument
The requirements are:
tolower all remove all non-alpha
characters replace multiple
whitespace by one blank. Any leading
whitespace at the beginning of the
array should be removed completely.
The resulting number of characters
should be returned as the value of
the function.
And the annoying part:
Another array cannot appear in the function
Cannot use strings, only char arrays.
Cannot using G++'s extension for setting an array size using a variable.
Oh and can't use regex :)
I'm stuck with this, any help would be great. :)