Search:

Type: Posts; User: helloworld922

Search: Search took 0.13 seconds.

  1. Replies
    5
    Views
    2,539

    Re: Scrambling a String

    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...
  2. Replies
    5
    Views
    2,539

    Re: Scrambling a String

    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...
  3. Replies
    5
    Views
    2,539

    Re: Scrambling a String

    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...
Results 1 to 3 of 3