We need some examples about Strings and StringBuilder
We are looking for String problems to solve in java, easy medium and hard.
hi there,
What is it you are after in regards to this? Example programs that do something string related?
eg,
- count the vowels/upper case chars/whatever
- Build a string using a string builder (CSVs could be quite a good example for this)
- String formatting using String.format?
Are you after solutions or problems? What kind of tasks would you consider easy, medium and hard?
@webpigeon I'm a teacher, from a cs1 course, so i'm looking for different problems, more like a challenge for my students. Some are really good programming, but another are starting. So we like to have, easy problems like reverse a string, change vowels to upper case that maybe is easy, compare if to string are palindrome is medium, and a game like hangman could be hard. So you could help with code, or with the problem. Thank you
Hey @webpigeon I would be glad to help. Let me know whether you want me to help with the problem statements or the code.
@balachandarsv Go ahead, we need different level of dificulty.
What do think about an easy problem of string anagram?
@balachandarsv can i help too?
@claspina Easy is fine, go ahead please.
@balachandarsv Course, we appreciate your help
Can I help you?
One of the best uses of StringBuilder is implementing the .toString() method of abstract data types. Take for example returning the String representation of a Set: "{a,b,c,...}", a vector: "[1,2,3]", or even better a polynomial: "ax^2+bx+c".
How about this problem: Convert a int/long to its base B representation (e.g. to Hexadecimal) Also interesting from the performance perspective to compare implementations using String concatenation vs using a StringBuilder.
@domitilacrispim Course, we want each topic goes from easy to hard, because we have students from any levels.
I have added some string examples in PR #62
PR #72 contains fixes and a request for feedback on the "pokemon" example