Skip to content

Conversation

@DenisBorisov-lab
Copy link

I propose an implemented stringCapitalize library function to convert the string so that each word starts with a capital letter.

s->data[0] = stringCharToUpper(s->data[0]);
}
for (size_t i = 1; i < s->size; ++i) {
if (s->data[i - 1] == ' ' && 'a' <= s->data[i] && s->data[i] <= 'z') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is good.
The separators can be one of ' ', '\n', '\t', ',', '.'
Make a separate function for check if symbol is a separator

stringCapitalize(&spaceThenDigitsTString);
stringCapitalize(&specialSignThenDigitsTestString);

assertEq(stringLen(simpleTString), stringLen(expectedSimpleTString));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to check the length? There is a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants