Une petite classe bien utile : Générer des chaînes aléatoires

Comment créer des chaînes aléatoires ? Je mes suis posé la question dernièrement, je commençais à partir sur une solution de génération aléatoire d’entier dans une plage donnée pour les convertir ensuite en caractère. Un truc simple mais fastidieux.
Et j’ai trouvé la classe RandomStringUtils de la librairie Commons Lang du projet Apache Commons.

Le lien vers la javadoc.

Un petit exemple :

public static void main(String[] args) {

for (int i=0 ; i<256; i++)

{

System.out.println(RandomStringUtils.random(64,true,true));

}

}

3 Comments

  1. nova88vn

    17 août 2026 - 3 h 38 min
    Reply

    Anyone from Vietnam using Nova88vn? How’s the experience been? Trying to find a reliable platform that caters to the local market and want to know if this is it. Give me a shout! nova88vn

  2. esportebet

    17 août 2026 - 3 h 38 min
    Reply

    Esportebet is good to know sports betting. With a lot of matches it might become your favorite betting site. See for yourself: esportebet

  3. 881betapp

    17 août 2026 - 3 h 38 min
    Reply

    Downloaded the 881betapp the other day. Clean interface, does the job. Quick and easy betting on the go, which is what I needed. Check it out! 881betapp

Leave a Reply

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur la façon dont les données de vos commentaires sont traitées.