Question d’entretien chez Microsoft

reverse a string in place

Réponse à la question d'entretien

Utilisateur anonyme

19 avr. 2012

static void Main(string[] args) { string s = "Rajababu"; int i = 0; char t; char[] c = s.ToCharArray(); for (i = 0; i < s.Length / 2; i++) { t = c[i]; c[i] = c[c.Length - 1 - i]; c[c.Length - 1 - i] = t; } for(i=0;i