﻿
{"id":10956,"date":"2019-05-16T14:18:39","date_gmt":"2019-05-16T14:18:39","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=10956"},"modified":"2019-05-16T14:20:45","modified_gmt":"2019-05-16T14:20:45","slug":"c-8-0-ranges-and-indices","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/c-8-0-ranges-and-indices\/","title":{"rendered":"C# 8.0 &#8211; Ranges and Indices"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>Yaz\u0131l\u0131m dillerinde koleksiyonlar veya diziler \u00fczerinde i\u015flem yaparken ilgili yap\u0131y\u0131 sadele\u015ftirmek yahut verisel a\u00e7\u0131dan man\u00fcp\u00fcle edebilmek i\u00e7in LINQ sorgular\u0131ndan ya da her t\u00fcrl\u00fc taraf\u0131m\u0131zca veya harici geli\u015ftirilmi\u015f algoritmalardan faydalan\u0131r\u0131z. C#, 8.0 versiyonunda koleksiyonel veri kaynaklar\u0131 \u00fczerinde gerekli manip\u00fclasyonu sa\u011flayabilmek ve bunun yan\u0131nda kaynak i\u00e7erisindeki t\u00fcm veriler \u00fczerinde yap\u0131lan genel sorgulamalar ve algoritmalardan ka\u00e7\u0131nmak, yani direkt olarak hedef veri\/ler odakl\u0131 \u00e7al\u0131\u015fabilmek i\u00e7in yeni tipler ile operat\u00f6rler geli\u015ftirmi\u015f bulunmaktad\u0131r.<\/p>\n<p>C# 8.0 ile gelen yeni tiplerimiz <em style=\"font-size:16px;color:grey;\">System.Index<\/em> ile <em style=\"font-size:16px;color:grey;\">System.Range<\/em> structerlar\u0131 iken, yeni i\u015flevsel operat\u00f6rlerimiz ise <strong style=\"color:red;\">..<\/strong> ile <strong style=\"color:red;\">^<\/strong> ifadeleridir.<\/p>\n<p>\u015eimdi gelin \u00f6ncelikle yeni \u00fcretilen tipleri ele alarak ard\u0131ndan s\u0131ras\u0131yla operat\u00f6rleri inceleyelim.<\/p>\n<h4 style=\"color:blue;\">System.Index<\/h4>\n<p>Dizi ve koleksiyon yap\u0131lar\u0131ndaki <span style=\"font-size:13px;color:red;\">index<\/span> kavram\u0131n\u0131n static tip olarak belirlenmi\u015f halidir. Temelde index de\u011ferini tutmakla beraber <strong style=\"color:red;\">^<\/strong> operat\u00f6r\u00fcyle birlikte daha fazla bir anlam ifade etmekte ve dizinin index de\u011ferlerini tersine ifade edecek \u015fekilde bir sorumluluk y\u00fcklenmektedir.<\/p>\n<p>\u015e\u00f6yle ki;<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"515\" height=\"67\" class=\"aligncenter size-full wp-image-10973\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices.png 515w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-300x39.png 300w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/a><br \/>\nYukar\u0131daki ekran g\u00f6r\u00fcnt\u00fcs\u00fcnde g\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere &#8220;Index&#8221; structer tipinde tan\u0131mlanan &#8220;index&#8221; isimli &#8220;3&#8221; de\u011ferine sahip de\u011fi\u015fken &#8220;isimler&#8221; referans\u0131na sahip string dizisinin 3. index de\u011ferine tekab\u00fcl etmektedir. Evet&#8230; Bu zaten bildi\u011fimiz bir durumdur. A\u015fa\u011f\u0131daki g\u00f6rselde g\u00f6z gezdirerek bir \u00fcstteki paragrafta bahsedilen <strong style=\"color:red;\">^<\/strong> operat\u00f6r\u00fc ile nas\u0131l bir \u00e7al\u0131\u015fma mant\u0131\u011f\u0131nda oldu\u011funuda inceleyelim.<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-1.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"493\" height=\"81\" class=\"aligncenter size-full wp-image-10976\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-1.png 493w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-1-300x49.png 300w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\" \/><\/a><\/p>\n<p>G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere index olarak tutulan say\u0131sal de\u011fer ^ operat\u00f6r\u00fc ile tersine bir index olarak tan\u0131mlanm\u0131\u015ft\u0131r. Dolay\u0131s\u0131yla bu \u015fekilde tan\u0131mlanan bir ifade herhangi bir dizi yahut koleksiyonel bir de\u011ferde tersine indexe denk gelen datay\u0131 bizlere getirecektir. Burada dikkat edilmesi gereken nokta \u015fudur ki; tersine index durumlar\u0131nda index de\u011ferleri 0&#8217;dan de\u011fil 1&#8217;den ba\u015flamas\u0131d\u0131r.<\/p>\n<p>&#8220;Index&#8221; tipinin buradaki en b\u00fcy\u00fck avantaj\u0131, tersine index durumunun say\u0131sal olarak elimizde ifade edilmesini sa\u011flamas\u0131d\u0131r. Normal \u015fartlarda herhangi bir say\u0131sal de\u011fi\u015fkende bu de\u011feri ifade etmemiz m\u00fcmk\u00fcn de\u011fildir.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-2.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"114\" height=\"30\" class=\"aligncenter size-full wp-image-10980\" \/><\/a><\/p>\n<p>Index tipinin kullan\u0131m\u0131na dair a\u015fa\u011f\u0131daki \u00f6rne\u011fi inceleyebilirsiniz.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string&#x5B;] isimler = { &quot;H\u00fcseyin&quot;, &quot;Hilmi&quot;, &quot;R\u0131fk\u0131&quot;, &quot;Hatice&quot;, &quot;Ay\u015fe&quot;, &quot;Mahmut&quot;, &quot;Kaz\u0131m&quot;, &quot;Okan&quot;, &quot;Emre&quot;, &quot;Ali&quot;, &quot;Naci&quot;, &quot;H\u00fcsn\u00fc&quot;, &quot;Kamil&quot; };\r\n\r\n            Index i1 = ^3;\r\n            Index i2 = 4;\r\n            Console.WriteLine($&quot;{isimler&#x5B;i1]} - {isimler&#x5B;i2]}&quot;);\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-3.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"94\" height=\"30\" class=\"aligncenter size-full wp-image-10983\" \/><\/a><\/p>\n<h4 style=\"color:blue;\">System.Range<\/h4>\n<p>Koleksiyonel veri \u00fczerinde hangi de\u011ferler ile \u00e7al\u0131\u015faca\u011f\u0131m\u0131z\u0131 belirleyebilmek i\u00e7in index \u00fczerinden aral\u0131k vermemizi ve bu ba\u011f\u0131nt\u0131y\u0131 <strong style=\"color:red;\">..<\/strong> operat\u00f6r\u00fc ile ger\u00e7ekle\u015ftirmemizi sa\u011flayan yap\u0131lanman\u0131n kendine \u00f6zg\u00fc t\u00fcr\u00fc Range yap\u0131s\u0131d\u0131r.<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"1308\" height=\"131\" class=\"aligncenter size-full wp-image-10990\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4.png 1308w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4-300x30.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4-768x77.png 768w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-4-1024x103.png 1024w\" sizes=\"auto, (max-width: 1308px) 100vw, 1308px\" \/><\/a><\/p>\n<p>Yukar\u0131daki g\u00f6rseli incelerseniz e\u011fer Range de\u011fi\u015fkeninin tuttu\u011fu aral\u0131\u011f\u0131n solundaki de\u011fer index bazl\u0131 bir g\u00f6stergeye sahipken, sa\u011f\u0131ndaki ise s\u0131ra numaras\u0131n\u0131 ifade etmektedir. Dolay\u0131s\u0131yla bu iki de\u011ferlere denk gelen verilerde dahil olmak \u00fczere aralar\u0131ndaki t\u00fcm veriler ilgili koleksiyonel de\u011ferde elde edilecektir. \u00d6rnek olarak g\u00f6rselin sonucu baz al\u0131n\u0131rsa; &#8220;Hatice&#8221;, &#8220;Ay\u015fe&#8221;, &#8220;Mahmut&#8221; ve &#8220;Kaz\u0131m&#8221; de\u011ferleri elde edilecektir.<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"1300\" height=\"119\" class=\"aligncenter size-full wp-image-10994\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5.png 1300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5-300x27.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5-768x70.png 768w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-5-1024x94.png 1024w\" sizes=\"auto, (max-width: 1300px) 100vw, 1300px\" \/><\/a><br \/>\nYine bir \u00fcstteki g\u00f6rselde elde edilen sonucu tekrar elde edebilmek i\u00e7in yukar\u0131daki gibi bir \u00e7al\u0131\u015fma ger\u00e7ekle\u015ftirebiliriz. Burada dikkat edilmesi gereken nokta, .. operat\u00f6r\u00fcn\u00fcn sa\u011f\u0131nda ya da solunda ^ operat\u00f6r\u00fc kullan\u0131l\u0131yorsa s\u0131ra numaras\u0131na denk gelen ilgili de\u011ferin koleksiyona dahil olmad\u0131\u011f\u0131d\u0131r.<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"1302\" height=\"164\" class=\"aligncenter size-full wp-image-10998\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6.png 1302w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6-300x38.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6-768x97.png 768w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-6-1024x129.png 1024w\" sizes=\"auto, (max-width: 1302px) 100vw, 1302px\" \/><\/a><br \/>\n\u00d6rne\u011fin yukar\u0131daki g\u00f6rseldeki \u00e7al\u0131\u015fmada; &#8220;Okan&#8221;, &#8220;Emre&#8221; ve &#8220;Ali&#8221; de\u011ferleri elde edilecektir.<\/p>\n<p>Range tipine \u00f6zel a\u015fa\u011f\u0131daki \u00f6rne\u011fi inceleyiniz;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string&#x5B;] isimler = { &quot;H\u00fcseyin&quot;, &quot;Hilmi&quot;, &quot;R\u0131fk\u0131&quot;, &quot;Hatice&quot;, &quot;Ay\u015fe&quot;, &quot;Mahmut&quot;, &quot;Kaz\u0131m&quot;, &quot;Okan&quot;, &quot;Emre&quot;, &quot;Ali&quot;, &quot;Naci&quot;, &quot;H\u00fcsn\u00fc&quot;, &quot;Kamil&quot; };\r\n            Range range = ^6..10;\r\n            foreach (var item in isimler&#x5B;range])\r\n            {\r\n                Console.WriteLine(item);\r\n            }\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-7.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"55\" height=\"54\" class=\"aligncenter size-full wp-image-11002\" \/><\/a><\/p>\n<p>Buda bir ikinci \u00f6rnek;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string&#x5B;] isimler = { &quot;H\u00fcseyin&quot;, &quot;Hilmi&quot;, &quot;R\u0131fk\u0131&quot;, &quot;Hatice&quot;, &quot;Ay\u015fe&quot;, &quot;Mahmut&quot;, &quot;Kaz\u0131m&quot;, &quot;Okan&quot;, &quot;Emre&quot;, &quot;Ali&quot;, &quot;Naci&quot;, &quot;H\u00fcsn\u00fc&quot;, &quot;Kamil&quot; };\r\n\r\n            Index i1 = 3;\r\n            Index i2 = ^7;\r\n            Range range = i1..i2;\r\n\r\n            foreach (var item in isimler&#x5B;range])\r\n            {\r\n                Console.WriteLine(item);\r\n            }\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-8.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-8.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"61\" height=\"50\" class=\"aligncenter size-full wp-image-11003\" \/><\/a><\/p>\n<p>Vee son \u00f6rnek;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string&#x5B;] isimler = { &quot;H\u00fcseyin&quot;, &quot;Hilmi&quot;, &quot;R\u0131fk\u0131&quot;, &quot;Hatice&quot;, &quot;Ay\u015fe&quot;, &quot;Mahmut&quot;, &quot;Kaz\u0131m&quot;, &quot;Okan&quot;, &quot;Emre&quot;, &quot;Ali&quot;, &quot;Naci&quot;, &quot;H\u00fcsn\u00fc&quot;, &quot;Kamil&quot; };\r\n            var list = isimler.ToList().GetRange(3, 4); \/\/Eski usul\r\n            var list2 = isimler.Skip(3).Take(4); \/\/Eski usul\r\n            Index i1 = 3;\r\n            Index i2 = 7;\r\n            Range range = i1..i2; \/\/Yeni usul\r\n\r\n            foreach (var item in isimler&#x5B;range])\r\n                Console.WriteLine(item);\r\n            Console.WriteLine(&quot;************&quot;);\r\n            foreach (var item in list)\r\n                Console.WriteLine(item);\r\n            Console.WriteLine(&quot;************&quot;);\r\n            foreach (var item in list2)\r\n                Console.WriteLine(item);\r\n<\/pre>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-9.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-9.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"69\" height=\"229\" class=\"aligncenter size-full wp-image-11008\" \/><\/a><\/p>\n<blockquote><p><strong>Indexer<span style=\"color:red;font-size:10px;\">[ ]<\/span> i\u00e7erisine tam say\u0131 verilebildi\u011fi gibi Range yahut Index t\u00fcr\u00fcde verilebilir.<\/strong><\/p><\/blockquote>\n<h4 style=\"color:green;\">.. Operat\u00f6r\u00fc<\/h4>\n<p>Koleksiyonel verilerde belirli aral\u0131\u011f\u0131 temsil eden operat\u00f6rd\u00fcr. Aral\u0131k operat\u00f6r\u00fc diyede isimlendirebiliriz. Genellikle indexer<span style=\"color:red;font-size:10px;\">[ ]<\/span> operat\u00f6r\u00fc i\u00e7erisinde indexsel aral\u0131\u011f\u0131 belirlemek i\u00e7in kullan\u0131l\u0131r.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-10.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-10.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"224\" height=\"55\" class=\"aligncenter size-full wp-image-11011\" \/><\/a><br \/>\nYukar\u0131daki ekran al\u0131nt\u0131s\u0131nda g\u00f6r\u00fcld\u00fc\u011f\u00fc gibi sa\u011f\u0131na ve soluna say\u0131sal bir de\u011fer alabildi\u011fi gibi \u00f6z\u00fc itibariyle System.Index t\u00fcr\u00fcnden de de\u011ferler alabilir ve geriye bir System.Range t\u00fcr\u00fcnden yap\u0131 d\u00f6nd\u00fcr\u00fcr. Bu yap\u0131 kullan\u0131larak ilgili de\u011ferlere kar\u015f\u0131l\u0131k gelen index aral\u0131klar\u0131na giren t\u00fcm verilerin elde edilmesini sa\u011flar.<\/p>\n<p>Eskiden .. operat\u00f6r\u00fc olmaks\u0131z\u0131n ihtiyaca d\u00f6n\u00fck operasyonlar\u0131 hangi i\u015flemlerle ger\u00e7ekle\u015ftiriyorduk aradaki fark\u0131 g\u00f6rmek i\u00e7in a\u015fa\u011f\u0131daki kod blo\u011funu inceleyiniz;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string&#x5B;] isimler = { &quot;H\u00fcseyin&quot;, &quot;Hilmi&quot;, &quot;R\u0131fk\u0131&quot;, &quot;Hatice&quot;, &quot;Ay\u015fe&quot;, &quot;Mahmut&quot;, &quot;Kaz\u0131m&quot;, &quot;Okan&quot;, &quot;Emre&quot;, &quot;Ali&quot;, &quot;Naci&quot;, &quot;H\u00fcsn\u00fc&quot;, &quot;Kamil&quot; };\r\n            var list = isimler.ToList().GetRange(3, 4); \/\/Eski usul\r\n            var list2 = isimler.Skip(3).Take(4); \/\/Eski usul\r\n            Index i1 = 3;\r\n            Index i2 = 7;\r\n            Range range = i1..i2; \/\/Yeni usul\r\n\r\n            foreach (var item in isimler&#x5B;range])\r\n                Console.WriteLine(item);\r\n            Console.WriteLine(&quot;************&quot;);\r\n            foreach (var item in list)\r\n                Console.WriteLine(item);\r\n            Console.WriteLine(&quot;************&quot;);\r\n            foreach (var item in list2)\r\n                Console.WriteLine(item);\r\n<\/pre>\n<p>Yerine geldi\u011fi genel kullan\u0131m operasyonlar\u0131na bak\u0131nca genellikle veri sayfalama vb. i\u015flemlerde olduk\u00e7a kullan\u0131\u015fl\u0131 bir i\u015fleve sahip oldu\u011fu a\u015fikard\u0131r.<\/p>\n<h4 style=\"color:green;\">^ Operat\u00f6r\u00fc<\/h4>\n<p>Koleksiyonel yap\u0131larda index de\u011ferinin tersini ifade eder. Normal index yap\u0131lanmas\u0131na nazaran ters index durumu 0&#8217;dan de\u011fil, 1&#8217;den ba\u015flamaktad\u0131r. Yani 10 elemanl\u0131 bir dizide; sonuncu eleman 9. indexe sahiptir lakin tersine operat\u00f6r\u00fcyle <del datetime=\"2019-05-16T13:36:52+00:00\">&#8220;^0&#8221;<\/del> de\u011fil &#8220;^1&#8221; de\u011ferine tekab\u00fcl etmektedir.<\/p>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/05\/C-8.0-Ranges-and-Indices-11.png\" alt=\"C# 8.0 - Ranges and Indices\" width=\"121\" height=\"70\" class=\"aligncenter size-full wp-image-11020\" \/><\/a><br \/>\nG\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere yan\u0131na yaz\u0131lan ifade say\u0131sal bir de\u011fer(tam say\u0131) olmak zorundad\u0131r. Sonu\u00e7 olarak geriye bir System.Index t\u00fcr\u00fcnden de\u011fer d\u00f6nd\u00fcr\u00fcr.<\/p>\n<p>^ operat\u00f6r\u00fc genellikle bir dizinin son eleman\u0131na eri\u015fmek i\u00e7in kulland\u0131\u011f\u0131m\u0131z a\u015fa\u011f\u0131daki kar\u0131\u015f\u0131k manevrasal algoritmadan bizleri kurtarmaktad\u0131r.<br \/>\nEski stil;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string isim = isimler&#x5B;isimler.Length - 1];\r\n<\/pre>\n<p>Yeni stil;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string isim = isimler&#x5B;^1];\r\n<\/pre>\n<p>Son s\u00f6z olarak;<br \/>\nHer yeni \u00f6zellikte oldu\u011fu gibi bu \u00f6zelliklerde biz yaz\u0131l\u0131mc\u0131lar i\u00e7in daha kafiyeli kod yazmam\u0131za olanak tan\u0131yacakt\u0131r. Lakin t\u00fcm bu \u00f6zellikler ba\u015fl\u0131 ba\u015f\u0131na bir anlam ifade etti\u011fi i\u00e7in C# programlama dili okunabilirlik ve anla\u015f\u0131labilirlik a\u00e7\u0131s\u0131ndan olduk\u00e7a zor bir hale b\u00fcr\u00fcnmektedir. Dili yeni \u00f6\u011frenenler daha temel mant\u0131ksal operat\u00f6rleri oturtmakta zorlan\u0131rken, \u00fcstt\u00fcne \u00fcstl\u00fck temel yap\u0131lar\u0131 ilgilendiren bu tarz yeni ve i\u015flevsel a\u00e7\u0131dan ileri d\u00fczel operat\u00f6rleri \u00f6\u011frenmeyi sonraki s\u00fcre\u00e7lere(g\u00fcnlere\/aylara ve hatta y\u0131llara) b\u0131rakmalar\u0131n\u0131 tavsiye ederim.<\/p>\n<p>\u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<br \/>\nSonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, Yaz\u0131l\u0131m dillerinde koleksiyonlar veya diziler \u00fczerinde i\u015flem yaparken ilgili yap\u0131y\u0131 sadele\u015ftirmek yahut verisel a\u00e7\u0131dan man\u00fcp\u00fcle edebilmek i\u00e7in LINQ sorgular\u0131ndan ya da her t\u00fcrl\u00fc taraf\u0131m\u0131zca veya harici geli\u015ftirilmi\u015f algoritmalardan faydalan\u0131r\u0131z. C#, 8.0 versiyonunda koleksiyonel&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":11028,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2857],"tags":[1758,2858,2861,2860,2859,2862],"class_list":["post-10956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-8-0","tag-c-operatoru","tag-c-8-0","tag-indices","tag-ranges","tag-ranges-and-indices","tag-system-index"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=10956"}],"version-history":[{"count":58,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10956\/revisions"}],"predecessor-version":[{"id":11026,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/10956\/revisions\/11026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/11028"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=10956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=10956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=10956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}