{"id":875,"date":"2025-08-31T16:07:30","date_gmt":"2025-08-31T16:07:30","guid":{"rendered":"https:\/\/nurlandroid.com\/?p=875"},"modified":"2025-08-31T16:07:31","modified_gmt":"2025-08-31T16:07:31","slug":"extension-%d0%b2-%d0%ba%d0%be%d1%82%d0%bb%d0%b8%d0%bd%d0%b5-%d0%ba%d0%b0%d0%ba-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d1%8e%d1%82-%d0%bc%d0%be%d0%b6%d0%bd%d0%be-%d0%bb%d0%b8-%d1%81%d0%b4%d0%b5%d0%bb","status":"publish","type":"post","link":"https:\/\/nurlandroid.com\/?p=875","title":{"rendered":"Extension \u0432 \u043a\u043e\u0442\u043b\u0438\u043d\u0435, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442? \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c extension \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443?"},"content":{"rendered":"\n<p>Extension-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0438\u0448\u0435\u043a Kotlin, \u0434\u0430\u044e\u0449\u0430\u044f <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440<\/strong>. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 &#171;\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#187; \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0442\u0438\u043f\u0443 <strong>\u0431\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430<\/strong>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfun String.firstChar(): Char = this&#x5B;0]\n\nval c = &quot;Nurlan&quot;.firstChar() \/\/ 'N'\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 extension-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c<\/strong>?<\/h4>\n\n\n\n<p>\u042d\u0442\u043e <strong>\u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0430\u0451\u0442 <strong>\u043e\u0441\u043e\u0431\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/strong>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/Kotlin\nfun String.firstChar(): Char = this&#x5B;0]\n\n\/\/Java\npublic static final char firstChar(@NotNull String $this$firstChar) {\n    return $this$firstChar.charAt(0);\n}\n<\/pre><\/div>\n\n\n<p>\u0422\u043e \u0435\u0441\u0442\u044c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>this<\/code> \u2192 <strong>\u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442<\/strong><\/li>\n\n\n\n<li><strong>\u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <code>String<\/code> \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/strong><\/li>\n\n\n\n<li><strong>\u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430<\/strong> \u2014 \u043f\u0440\u043e\u0441\u0442\u043e <strong>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0440\u044e\u043a<\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c extension \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443?<\/h4>\n\n\n\n<p>\u0414\u0430, <strong>\u043c\u043e\u0436\u043d\u043e!<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ninterface Clickable {\n    fun click()\n}\n\nfun Clickable.logClick() {\n    println(&quot;Clicked!&quot;)\n}\n<\/pre><\/div>\n\n\n<p>\u041d\u043e \u0432\u0430\u0436\u043d\u043e: <strong>\u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0438 \u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0448\u044c extension \u2014 \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0451<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Extension-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0438\u0448\u0435\u043a Kotlin, \u0434\u0430\u044e\u0449\u0430\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 &#171;\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#187; \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0442\u0438\u043f\u0443 \u0431\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 extension-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c? \u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0430\u0451\u0442 \u043e\u0441\u043e\u0431\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441. \u0422\u043e \u0435\u0441\u0442\u044c: \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c extension \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443? \u0414\u0430, \u043c\u043e\u0436\u043d\u043e! \u041d\u043e \u0432\u0430\u0436\u043d\u043e: \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0438 \u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0448\u044c extension \u2014 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,31],"tags":[],"class_list":["post-875","post","type-post","status-publish","format-standard","hentry","category-kotlin","category-questions"],"_links":{"self":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=875"}],"version-history":[{"count":1,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":878,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/875\/revisions\/878"}],"wp:attachment":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}