sscanf icon indicating copy to clipboard operation
sscanf copied to clipboard

Suggestion: Words

Open Crayder opened this issue 9 years ago • 4 comments

Simply put, a word specifier ('w'). It will take everything up to a space or custom delimiter. It's basically like the string specifier when there are parameters after it but takes a specified amount of words.

Format: w<word count>[string size]

sscanf("bleh bleh teh faq yuu mein", "w<2>[24]w<4>[48]", words1, words2); words1 will be "bleh bleh", words2 will be "teh faq yuu mein"

Crayder avatar Nov 25 '16 17:11 Crayder

I get it that it would make it simpler but as long as string arrays exist, I don't really see a point:

new words1[2][12], words2[4][12];
sscanf("bleh bleh teh faq yuu mein", "a<s[12]>[2]a<s[12]>[4]", words1, words2);

It's not that we cannot "join" those words with a space or custom delimiter and make it work.

Konstantinos-Sk avatar Nov 25 '16 17:11 Konstantinos-Sk

I get it that it would make it simpler but as long as string arrays exist, I don't really see a point:

It's not that we cannot "join" those words with a space or custom delimiter and make it work.

You just contradicted your self like three times in the same comment.

Yes, simpler is the point. An array of strings is much more complicated than a few words in one string.

Storing them in an array and joining them is part of the work the sccanf plugin was built to relief!

Crayder avatar Nov 25 '16 19:11 Crayder

I agree with Crayder here, it would be simpler, so why it's not implanted yet :p

JustMe77 avatar Dec 28 '16 22:12 JustMe77

This is a good idea. Ignore the merge comment above, that's a result of combining two different repos in to one giving conflicting IDs.

Y-Less avatar Mar 28 '22 22:03 Y-Less