Outils pour utilisateurs

Outils du site


lang:csharp:array

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
lang:csharp:array [2016/12/15 16:45] – Ajout de "Comparaison de deux tableaux" rootlang:csharp:array [2020/04/28 17:19] (Version actuelle) – mhtml -> html root
Ligne 5: Ligne 5:
 string[] array = { "A" , "B" }; // creates populated array of length 2 string[] array = { "A" , "B" }; // creates populated array of length 2
 </code> </code>
-[[http://stackoverflow.com/questions/5678216/all-possible-c-sharp-array-initialization-syntaxes|Source]]{{ :lang:csharp:array:all_possible_c_array_initialization_syntaxes_-_stack_overflow.maff |Archive}}+[[http://stackoverflow.com/questions/5678216/all-possible-c-sharp-array-initialization-syntaxes|All possible C# array initialization syntaxes - Stack Overflow]] {{ :lang:csharp:array:c_-_all_possible_array_initialization_syntaxes_-_stack_overflow_2020-04-28_4_53_48_pm_.html |Archive du 15/04/2011 le 28/04/2020}}
  
 =====Comparaison de deux tableaux===== =====Comparaison de deux tableaux=====
Ligne 12: Ligne 12:
 </code> </code>
  
-[[http://stackoverflow.com/questions/3232744/easiest-way-to-compare-arrays-in-c-sharp|Source]]{{ :lang:csharp:array:net_-_easiest_way_to_compare_arrays_in_c_-_stack_overflow.maff |Archive}}+[[http://stackoverflow.com/questions/3232744/easiest-way-to-compare-arrays-in-c-sharp|_net - Easiest way to compare arrays in C# - Stack Overflow]] {{ :lang:csharp:array:net_-_easiest_way_to_compare_arrays_in_c_-_stack_overflow_2020-04-28_4_53_48_pm_.html |Archive du 12/04/2010 le 28/04/2020}} 
 + 
 +=====Enlever le dernier élément d'une liste===== 
 +<code csharp> 
 +Array.Resize(ref result, result.Length - 1); 
 +</code> 
 +[[http://stackoverflow.com/questions/26946196/c-sharp-deleting-last-item-from-array-of-string|C# Deleting Last Item from Array of String - Stack Overflow]] {{ :lang:csharp:array:c_-_deleting_last_item_from_array_of_string_-_stack_overflow_2020-04-28_4_53_46_pm_.html |Archive du 15/11/2014 le 28/04/2020}} 
 + 
 +=====Ecriture d'un tableau vers un fichier===== 
 +<code csharp> 
 +File.WriteAllLines("SavedLists.txt", Lists.verbList); 
 +</code> 
 + 
 +[[http://stackoverflow.com/questions/15300572/saving-lists-to-txt-file|c# - Saving lists to txt file - Stack Overflow]] {{ :lang:csharp:array:c_-_saving_lists_to_txt_file_-_stack_overflow_2020-04-28_4_53_45_pm_.html |Archive du 08/03/2013 le 28/04/2020}} 
 + 
 +=====IndexOf insensible à la casse===== 
 +''Array.IndexOf'' ne permet que du sensible à la casse. Pour du insensible à la casse, il faut passer par une fonction lambda. 
 + 
 +<code csharp> 
 +Array.FindIndex(myarr, t => t.IndexOf(str, StringComparison.InvariantCultureIgnoreCase) >=0); 
 +</code> 
 + 
 +[[https://stackoverflow.com/questions/8935161/how-to-add-a-case-insensitive-option-to-array-indexof|c# - How to add a case-insensitive option to Array.IndexOf - Stack Overflow]] {{ :lang:csharp:array:c_-_how_to_add_a_case-insensitive_option_to_array.indexof_-_stack_overflow_2020-04-28_4_53_46_pm_.html |Archive du 20/01/2012 le 28/04/2020}}
lang/csharp/array.1481816745.txt.gz · Dernière modification : 2016/12/15 16:45 de root