Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
lang:csharp:array [2016/12/16 18:22] – Ajout de "Ecriture d'un tableau vers un fichier" root | lang:csharp:array [2020/04/28 17:19] (Version actuelle) – mhtml -> html root |
---|
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===== |
</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===== | =====Enlever le dernier élément d'une liste===== |
Array.Resize(ref result, result.Length - 1); | Array.Resize(ref result, result.Length - 1); |
</code> | </code> |
[[http://stackoverflow.com/questions/26946196/c-sharp-deleting-last-item-from-array-of-string|Source]], {{ :lang:csharp:array:c_deleting_last_item_from_array_of_string_-_stack_overflow.maff |Archive}} | [[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===== | =====Ecriture d'un tableau vers un fichier===== |
</code> | </code> |
| |
[[http://stackoverflow.com/questions/15300572/saving-lists-to-txt-file|Source]], {{ :lang:csharp:array:c_-_saving_lists_to_txt_file_-_stack_overflow.maff |Archive}} | [[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}} |