Yep, there's a StringBuilder constructor which takes a string.
If you're unsure about whether something is possible or not, there are 2 good courses of action:
1. Try it
2. Look at the Javadoc...
Type: Posts; User: helloworld922
Yep, there's a StringBuilder constructor which takes a string.
If you're unsure about whether something is possible or not, there are 2 good courses of action:
1. Try it
2. Look at the Javadoc...
Remove it from your original string. This is much easier to do with a StringBuilder because it is mutable where Strings are not.
// removing a letter from a StringBuilder
StringBuilder b = new...
that's kind of difficult since strings are basically just character arrays...
but none the less, what you could do is create a new string result, then randomly remove a letter from the original...