Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun generarStringAleatorio1() {
- val string = UUID.randomUUID().toString().substring(0, 12);
- Log.e("String Aleatorio 1: ", string);
- }
- fun generarStringAleatorio2() {
- val caracteres = ('A'..'Z') + ('a'..'z') + ('0'..'9');
- var string = ""
- for(i in (1..10)){
- string += caracteres[(Math.random() * (caracteres.size - 1)).roundToInt()]
- }
- Log.e("String Aleatorio 2: ", string);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement