Trier les mots dans une chaîneJe voudrais trier les mots par ordre alphabétique dans une chaîne.Je suis coincé en essayant de récupérer la liste en une seule chaîne.
string= "sort this sentence";
string_list = sort list(words(string )); // string_list = {"sentence", "sort", "this"};
Sorted_string = (string_list); // not sure how to create Sorted_string = "sentence sort this"
show(string, string_list, Sorted_string);Automatisation et scriptsRe : Trier des mots dans une chaîneDans JMP, vous pouvez utiliser Concaténer des éléments()
Names Default To Here(1);
Concat Items({"www", "jmp", "com"}, "."); //"www.jmp.com"Re : Trier des mots dans une chaîneMerci, vous m'avez mis sur la bonne voie.
string= "sort this sentence";
string_list = sort list(words(string));
sorting_string = "";
for(i=1, i<=nitems(string_list), i++,
if(i<NITEMS></NITEMS><BR />----------------<BR />Log:<BR />string = "sort this sentence";<BR />string_list = {"sentence", "sort", "this"};<BR />Sorting_string = "sentence sort this";<BR />Re : Trier des mots dans une chaîneJe suggérerais quand même d'utiliser Concat Items() dans des cas comme celui-ci
Names Default To Here(1);
string = "sort this sentence";
string_list = Sort List(Words(string));
Sorted_string = Concat Items(string_list, " ");
Show(string, string_list, Sorted_string);
string = "sort this sentence";
string_list = {"sentence", "sort", "this"};
Sorted_string = "sentence sort this";Re : Trier des mots dans une chaîneParfait! Merci!