Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked sRandom [By Expermicid]


Expermicid

Recommended Posts

Funcion que genera un variable randomizada, tomando como caracteres un alfabeto definido previamente.

 

[lenguaje=java]/* Funcion sRandom

* Autor : Expermicid

* Fecha : 12/10/12

* Modo de uso : sRandom(Longitud)

*/

private static String sRandom(int longitud) {

 

String aux = "";

String alfabeto = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int cant = 32;

int i;

 

for (i=1;i<=longitud;i++) {

aux = aux + alfabeto.charAt((int)(Math.random()*cant)+1);

}

 

return aux;

 

}[/lenguaje]

 

En funcionamiento

 

This is the hidden content, please

 

Saludos

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.