Bonjour,
J'ai cherché partout comment je pouvais faire mais pas moyen de trouver ce que je souhaite.
Je voudrais inverser une chaîne hexa :
Par exemple j'ai 01 23 15 et je voudrais l'inverser pour avoir 10 32 51
J'ai essayé
ou
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 public static string Reverse(string text) { char[] chars = text.ToCharArray(); Array.Reverse(chars); return new String(chars); }
Mais à chaque fois, ça m'inverse toute la chaîne, alors que l'inversion doit se faire tous les 2 caractères. Cela n'est peut-être pas possible à faire.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 public static string Reverse(string text) { return String.Concat(text.Reverse()); }
Merci.
Partager