Question d’entretien chez TireBuyer.com

how to reverse a string?

Réponse à la question d'entretien

Utilisateur anonyme

11 janv. 2012

public class reverse { public static String reverseIt(String a) { int length = a.length(); StringBuilder reverse = new StringBuilder(); for(int i = length; i > 0; --i) { char result = a.charAt(i-1); reverse.append(result); } return reverse.toString(); } }