It returns a string with its characters in random order.

@param value The input String
@return The shuffled String
976629
public static String shuffle(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        String[] chars = chars(value);
        Random random = new Random();
        for (int i = 0; i < chars.length; i++) {
            int r = random.nextInt(chars.length);
            String tmp = chars[i];
            chars[i] = chars[r];
            chars[r] = tmp;
        }
        return Arrays.stream(chars).collect(joining());
    }
520279
public static int generate(String value)
  {
    int len = value.length();
    int crc = 0;

    for (int i = 0; i < len; i++) {
      crc = next(crc, value.charAt(i));
    }

    return crc;
  }
1102917
public static String toUnicodeHex(int value) {
		final StringBuilder builder = new StringBuilder(6);

		builder.append("\\u");
		String hex = toHex(value);
		int len = hex.length();
		if (len < 4) {
			builder.append("0000", 0, 4 - len);// 不足4位补0
		}
		builder.append(hex);

		return builder.toString();
	}
846704
public static String encodeString(String value) {
    if (value == null) {
      return null;
    }
    StringBuilder encoded = new StringBuilder();
    int len = value.length();
    for (int i = 0; i < len; i++) {
      char c = value.charAt(i);
      switch (c) {
        case ARRAY_DELIMITER_CHAR:
        case KEY_VALUE_DELIMITER_CHAR:
        case ESCAPE_CHAR:
          encoded.append(ESCAPE_CHAR);
          break;
        default:
          // just append char
      }
      encoded.append(c);
    }
    return encoded.toString();
  }
722417
public static void shuffle (Object[] values, int offset, int length)
    {
        shuffle(values, offset, length, _rnd);
    }
807389
public static String randomString(int length) {
        // CAUSE: If-Else Statements Should Use Braces
        if (length < 1) {
            throw new IllegalArgumentException(String.format("length < 1: %s", length));
        }

		char[] buf = new char[length];

		return nextString(buf);
	}
627991
def random_chars(number):
    """"""
    char_map = {
        k: v for k, v in chars.CHARS.iteritems()
        if not format_character(k).startswith('\\x')
    }

    char_num = sum(char_map.values())
    return (
        format_character(nth_char(char_map, random.randint(0, char_num - 1)))
        for _ in xrange(0, number)
    )
233691
public static String format(Object value) {
        if (value instanceof Byte)      return formatByte((Byte) value);
        if (value instanceof Short)     return formatShort((Short) value);
        if (value instanceof Long)      return formatLong((Long) value);
        if (value instanceof Float)     return formatFloat((Float) value);
        if (value instanceof Double)    return formatDouble((Double) value);
        if (value instanceof Character) return formatChar((Character) value);
        if (value instanceof String)    return formatString((String) value);
        if (value instanceof Integer ||
            value instanceof Boolean)   return value.toString();
        else
            throw new IllegalArgumentException("Argument is not a primitive type or a string; it " +
                                               ((value == null) ?
                                                "is a null value." :
                                                "has class " +
                                                value.getClass().getName()) + "." );
    }
481220
public String asString(Object value) throws IOException, JSONObjectException
    {
        SegmentedStringWriter sw = new SegmentedStringWriter(_streamFactory._getBufferRecycler());
        try {
            _writeAndClose(value, _streamFactory.createGenerator(this, sw));
        } catch (JsonProcessingException e) {
            throw e;
        } catch (IOException e) { // shouldn't really happen, but is declared as possibility so:
            throw JSONObjectException.fromUnexpectedIOE(e);
        }
        return sw.getAndClear();
    }
1214671
public static void shuffle (Object[] values, Random rnd)
    {
        shuffle(values, 0, values.length, rnd);
    }
654032
public static Ordering shuffledBy(final Random random) {
        return new Ordering() {
            @Override
            boolean validateOrderingIsCorrect() {
                return false;
            }

            @Override
            protected List<Description> orderItems(Collection<Description> descriptions) {
                List<Description> shuffled = new ArrayList<Description>(descriptions);
                Collections.shuffle(shuffled, random);
                return shuffled;
            }
        };
    }
771778
public String asString(Object value) {

        if (value == null) {
            return "";
        }

        if (!this.isArray(value)) {
            return String.valueOf(value);
        }

        Object[] array = this.asArray(value);

        StringBuilder builder = new StringBuilder();

        for (Object obj : array) {
            builder.append(this.asString(obj));
        }

        return builder.toString();
    }
967819
public static String randomString( char[] values, int len )
    {
        Random rnd = new SecureRandom();
        StringBuilder sb = new StringBuilder( len );
        for ( int i = 0; i < len; i++ ) {
            sb.append( values[ rnd.nextInt( values.length )] );
        }
        return sb.toString();
    }
1091575
def _randomString():
    """"""

    return ''.join(
        random.choice(string.ascii_uppercase + string.digits)
        for x in range(10))
1085898
public static String sort(String str) {
        if (N.isNullOrEmpty(str)) {
            return str;
        }

        final char[] chs = str.toCharArray();
        Array.sort(chs);
        return StringUtil.newString(chs, true);
    }
406192
public String format(String value) {
        StringBuilder s = new StringBuilder();

        if (value != null && value.trim().length() > 0) {
            boolean continuationLine = false;

            s.append(getName()).append(":");
            if (isFirstLineEmpty()) {
                s.append("\n");
                continuationLine = true;
            }

            try {
                BufferedReader reader = new BufferedReader(new StringReader(value));
                String line;
                while ((line = reader.readLine()) != null) {
                    if (continuationLine && line.trim().length() == 0) {
                        // put a dot on the empty continuation lines
                        s.append(" .\n");
                    } else {
                        s.append(" ").append(line).append("\n");
                    }

                    continuationLine = true;
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return s.toString();
    }
150774
def shuffle(string):
    
    s = sorted(string)  # turn the string into a list of chars
    random.shuffle(s)  # shuffle the list
    return ''.join(s)