GUI StringBuilder

ericko_254

New member
Joined
Jun 3, 2020
Messages
2
Programming Experience
Beginner
Implement an extension method for class StringBuilder to count the number of words contained in a StringBuilder object. For example, if a StringBuilder object sb=”This is to test whether the extension method count can return a right answer or not”, the number of words contained in sb is 16.

Write a GUI application that will allow user to input a number of words that s/he wants in a sentence. Using StringBuilder create a sentence with the specified number of words. The words in the sentence have random ASCII characters. A number of characters in each word is random number between 1 and 20

please help
 
Last edited by a moderator:
What have you tried and where are you stuck? It's not for us to do your homework for you but we can help with actual issues you encounter while you're doing it for yourself. I guess the first question whether or not you have learned how to write extension methods.
 
Also consider that the ASCII range of characters includes the value of 0 (NUL). How will you handle that character when the Windows GUI which prefers to end strings with a NUL character, but the string actually continues past it?
Screenshot_1.png

Notice how the string length is 11 characters, but only 5 characters of the string are displayed.
 
What have you tried and where are you stuck? It's not for us to do your homework for you but we can help with actual issues you encounter while you're doing it for yourself. I guess the first question whether or not you have learned how to write extension methods.
i just wanted guidance and already got it. Thankyou
this is what u received and has helped me

1. Search for creating an extension menthod.
2. How to Count the words in StringBuilder
3. Adding a range of characters to be inserting in StringBuilder
4. How to use extension method.
5. Have a sip of cofee and say I had done it.
 
So you discovered the search engine? :LOL: Congrats!

If you get stuck along the way, you can come back and tell us where you get stuck. (y)
 
Back
Top Bottom