lundi 18 décembre 2017

How to randomly insert characters in a String using insert method

I'm doing a project and I need to develop a Class or method that puts randomly characters into a String

I insert a String via Scanner.

I was thinking using the String method insert. But I don´t know if that works because the method needs also read the empty space and doesn't do anything and move to the next word.

Eg:

Input: "Hello World"

Output: "HpEjLrLqO WnOvRbLyD"

(I put the Letter in Bold from the original Word)

In this case, i need that the program insert random character in x+1, in other words, read the first letter skip and the second position he puts a random letter and so on and so on..




Aucun commentaire:

Enregistrer un commentaire