{"id":4189,"date":"2023-07-13T00:00:32","date_gmt":"2023-07-13T00:00:32","guid":{"rendered":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/"},"modified":"2023-07-13T00:00:32","modified_gmt":"2023-07-13T00:00:32","slug":"r-dizeyi-bol-ve-ilk-ogeyi-al","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/","title":{"rendered":"C: bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l al\u0131n\u0131r?"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">R&#8217;de bir dizeyi b\u00f6lmek ve ilk \u00f6\u011feyi almak i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>strsplit(string_var, \" \")[[ <span style=\"color: #008000;\">1<\/span> ]][ <span style=\"color: #008000;\">1<\/span> ]\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Bu \u00f6zel \u00f6rnek, bir dizeyi bo\u015fluklara dayal\u0131 olarak b\u00f6ler, ancak onu farkl\u0131 bir s\u0131n\u0131rlay\u0131c\u0131ya b\u00f6lmek i\u00e7in <strong>strsplit()<\/strong> i\u015flevine ikinci ba\u011f\u0131ms\u0131z de\u011fi\u015fkene herhangi bir de\u011fer sa\u011flayabilirsiniz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u00d6rne\u011fin, bir dizeyi tirelere g\u00f6re b\u00f6lmek i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>strsplit(string_var, \"-\")[[ <span style=\"color: #008000;\">1<\/span> ]][ <span style=\"color: #008000;\">1<\/span> ]<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki \u00f6rnek, bu s\u00f6zdiziminin pratikte nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 g\u00f6sterir.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>\u00d6rnek: bir dizeyi b\u00f6l\u00fcn ve R&#8217;deki ilk \u00f6\u011feyi al\u0131n<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, R&#8217;de belirli bir dizenin bo\u015fluklara g\u00f6re nas\u0131l b\u00f6l\u00fcnece\u011fini ve ilk \u00f6\u011fenin nas\u0131l al\u0131naca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#define string variable\n<\/span>string_var &lt;- \"This is a string variable\"\n\n<span style=\"color: #008080;\">#split string variable based on spaces and get first element\n<\/span>strsplit(string_var, \" \")[[ <span style=\"color: #008000;\">1<\/span> ]][ <span style=\"color: #008000;\">1<\/span> ]\n\n[1] \u201cThis\u201d\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\"><strong>strsplit()<\/strong> i\u015flevi, dize de\u011fi\u015fkeninin ilk \u00f6\u011fesi olan &#8220;This&#8221; \u00f6\u011fesini d\u00f6nd\u00fcr\u00fcr.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Farkl\u0131 bir \u00fcr\u00fcn almak istiyorsan\u0131z son parantez i\u00e7indeki rakam\u0131 de\u011fi\u015ftirmeniz yeterli olacakt\u0131r.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u00d6rne\u011fin, dizeyi bo\u015fluklara g\u00f6re b\u00f6lmek ve ikinci \u00f6\u011feyi elde etmek i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#define string variable\n<\/span>string_var &lt;- \"This is a string variable\"\n\n<span style=\"color: #008080;\">#split string variable based on spaces and get second element\n<\/span>strsplit(string_var, \" \")[[ <span style=\"color: #008000;\">1<\/span> ]][ <span style=\"color: #008000;\">2<\/span> ]\n\n[1] \u201cis\u201d\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Bu kez <strong>strsplit()<\/strong> i\u015flevi ikinci \u00f6\u011feyi al\u0131r.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Ayr\u0131ca, bir dize de\u011fi\u015fkenini tirelere dayal\u0131 olarak b\u00f6lmek ve ilk \u00f6\u011feyi almak i\u00e7in <span style=\"color: #000000;\"><strong>strsplit()<\/strong><\/span> i\u015flevindeki bo\u015flu\u011fu k\u0131sa \u00e7izgi gibi farkl\u0131 bir s\u0131n\u0131rlay\u0131c\u0131yla de\u011fi\u015ftirebilece\u011fimizi unutmay\u0131n:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#define string variable\n<\/span>string_var &lt;- \"This-is-a-string-variable\"\n\n<span style=\"color: #008080;\">#split string variable based on dashes and get first element\n<\/span>strsplit(string_var, \"-\")[[ <span style=\"color: #008000;\">1<\/span> ]][ <span style=\"color: #008000;\">1<\/span> ]\n\n[1] \u201cThis\u201d<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>strsplit()<\/strong> i\u015flevi ilk \u00f6\u011fe olarak \u201cThis\u201d \u00f6\u011fesini do\u011fru bir \u015fekilde d\u00f6nd\u00fcr\u00fcr.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>\u0130lgili:<\/strong> <a href=\"https:\/\/statorials.org\/tr\/rde-strsplit-islevi\/\" target=\"_blank\" rel=\"noopener\">R&#8217;deki strsplit() i\u015flevine giri\u015f<\/a><\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Ek kaynaklar<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki e\u011fitimlerde R&#8217;de di\u011fer ortak g\u00f6revlerin nas\u0131l ger\u00e7ekle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r:<\/span><\/p>\n<p><a href=\"https:\/\/statorials.org\/tr\/r-dizedeki-son-karakteri-kaldir\/\" target=\"_blank\" rel=\"noopener\">R&#8217;deki bir dizeden son karakter nas\u0131l kald\u0131r\u0131l\u0131r<\/a><br \/> <a href=\"https:\/\/statorials.org\/tr\/r-dizedeki-karakteri-arayin\/\" target=\"_blank\" rel=\"noopener\">R&#8217;de bir dizedeki karakter konumu nas\u0131l bulunur?<\/a><br \/><a href=\"https:\/\/statorials.org\/tr\/r-dizeyi-iceren-sutunlari-secin\/\" target=\"_blank\" rel=\"noopener\">R&#8217;de belirli bir dize i\u00e7eren s\u00fctunlar nas\u0131l se\u00e7ilir<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R&#8217;de bir dizeyi b\u00f6lmek ve ilk \u00f6\u011feyi almak i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz: strsplit(string_var, &#8221; &#8220;)[[ 1 ]][ 1 ] Bu \u00f6zel \u00f6rnek, bir dizeyi bo\u015fluklara dayal\u0131 olarak b\u00f6ler, ancak onu farkl\u0131 bir s\u0131n\u0131rlay\u0131c\u0131ya b\u00f6lmek i\u00e7in strsplit() i\u015flevine ikinci ba\u011f\u0131ms\u0131z de\u011fi\u015fkene herhangi bir de\u011fer sa\u011flayabilirsiniz. \u00d6rne\u011fin, bir dizeyi tirelere g\u00f6re b\u00f6lmek i\u00e7in a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz: strsplit(string_var, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-4189","post","type-post","status-publish","format-standard","hentry","category-rehber"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials<\/title>\n<meta name=\"description\" content=\"Bu e\u011fitimde, R&#039;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials\" \/>\n<meta property=\"og:description\" content=\"Bu e\u011fitimde, R&#039;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-13T00:00:32+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/\",\"url\":\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/\",\"name\":\"C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-13T00:00:32+00:00\",\"dateModified\":\"2023-07-13T00:00:32+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Bu e\u011fitimde, R&#39;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C: bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l al\u0131n\u0131r?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/tr\/#website\",\"url\":\"https:\/\/statorials.org\/tr\/\",\"name\":\"Statorials\",\"description\":\"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/tr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil\",\"sameAs\":[\"https:\/\/statorials.org\/tr\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials","description":"Bu e\u011fitimde, R&#39;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/","og_locale":"tr_TR","og_type":"article","og_title":"C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials","og_description":"Bu e\u011fitimde, R&#39;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.","og_url":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/","og_site_name":"Statorials","article_published_time":"2023-07-13T00:00:32+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Dr.benjamin anderson","Tahmini okuma s\u00fcresi":"2 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/","url":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/","name":"C: Bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l elde edilir - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-13T00:00:32+00:00","dateModified":"2023-07-13T00:00:32+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Bu e\u011fitimde, R&#39;de bir dizenin nas\u0131l b\u00f6l\u00fcnece\u011fi ve ilk \u00f6\u011fenin nas\u0131l \u00e7\u0131kar\u0131laca\u011f\u0131 birka\u00e7 \u00f6rnekle a\u00e7\u0131klanmaktad\u0131r.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/r-dizeyi-bol-ve-ilk-ogeyi-al\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"C: bir dize nas\u0131l b\u00f6l\u00fcn\u00fcr ve ilk \u00f6\u011fe nas\u0131l al\u0131n\u0131r?"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/tr\/#website","url":"https:\/\/statorials.org\/tr\/","name":"Statorials","description":"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/tr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"tr"},{"@type":"Person","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil","sameAs":["https:\/\/statorials.org\/tr"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/4189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/comments?post=4189"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/4189\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=4189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=4189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=4189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}