{"id":112,"date":"2020-01-23T00:10:47","date_gmt":"2020-01-22T15:10:47","guid":{"rendered":"https:\/\/blog.daymore.com\/?p=112"},"modified":"2020-02-03T21:56:32","modified_gmt":"2020-02-03T12:56:32","slug":"swift-string-character-%ec%82%b4%ed%8e%b4%eb%b3%b4%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/blog.daymore.com\/?p=112","title":{"rendered":"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30"},"content":{"rendered":"\n<p>The Swift Programming Language (Swift 5.1) \uc5d0\uc11c Strings and Characters \uc5d0\uc11c \uc911\uc694\ud558\ub2e4\uace0 \uc0dd\uac01\ub418\ub294 \ubd80\ubd84\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public struct String {\n}\n\npublic struct Character {\n}<\/pre>\n\n\n\n<p>&#8211; String, Character\ub294 \uad6c\uc870\uccb4\uc774\ub2e4<br>&#8211; Character\uc758 \uc5f0\uc18d\uc774 String\uc774\ub2e4<br>&#8211; String, Character\ub294 \uad6c\uc870\uccb4\uc774\uae30 \ub54c\ubb38\uc5d0 \uac12 \ud0c0\uc785\uc774\ub2e4<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let char: Character = \"\\u{D55C}\"\n\/\/Character\uc5d0 \uc720\ub2c8\ucf54\ub4dc \uc2a4\uce7c\ub77c\ub97c \ub123\ub294\ub2e4\n\nlet a: Character = \"\\u{1112}\"\nlet b: Character = \"\\u{1161}\"\nlet c: Character = \"\\u{11AB}\"\n\n(String(a)+String(b)+String(c)) == \"\\u{1112}\\u{1161}\\u{11AB}\"   \n\/\/ true\n\/\/ Character\ub294 + \uc5f0\uc0b0\uc790 \uc0ac\uc6a9\ud560 \uc218 \uc5c6\uc74c, Character\uc758 \uc5f0\uc18d = String<\/pre>\n\n\n\n<p>String.Index\ub294 String\uc5d0\uc11c \uac01\uac01\uc758 Character \uc704\uce58\ub97c \ub098\ud0c0\ub0b8\ub2e4. String.Index\ub3c4 \uad6c\uc870\uccb4\uc774\ub2e4. \uc2a4\ud2b8\ub9c1 \uc778\ub371\uc2f1\uc740 \uac01\uac01\uc758 Character\ub9c8\ub2e4 \uba54\ubaa8\ub9ac\uc5d0 \uc800\uc7a5\ub418\ub294 \ud06c\uae30\uac00 \ub2e4\ub974\uae30 \ub54c\ubb38\uc5d0 \uc815\uc218\ud615\uc73c\ub85c \uc778\ub371\uc2f1 \ub420 \uc218 \uc5c6\uace0 String.Index\ub77c\ub294 \uad6c\uc870\uccb4\ub85c \ud45c\ud604\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let greeting = \"Guten Tag!\"\ngreeting[greeting.startIndex]   \/\/ G, String subscripts\ngreeting[greeting.index(before: greeting.endIndex)]  \/\/ !\u2019<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Substring &amp; Index\n\nlet greeting = \"Hello, world!\"\nlet index = greeting.index(of: \",\") ?? greeting.endIndex\nlet beginning = greeting[..&lt;index]<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let str = \"\ud55c\uae00\ud83d\ude0d\ud83c\udf6dab12\"\nstr.count    \/\/8, \uc2a4\ud2b8\ub9c1 \uae38\uc774 \ubcf4\ub2e4 \uac01\uac01\uc758 Character \uac2f\uc218\ub77c\uace0 \ub9d0\ud558\ub294\uac8c \ub9de\ub2e4<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">let dogString = \"Dog\u203c\ud83d\udc36\"<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png\" alt=\"\" class=\"wp-image-118\" width=\"360\" height=\"172\" srcset=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png 953w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-300x144.png 300w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-768x369.png 768w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><figcaption>UTF-8<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-1.png\" alt=\"\" class=\"wp-image-119\" width=\"365\" height=\"175\" srcset=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-1.png 954w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-1-300x144.png 300w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-1-768x369.png 768w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><figcaption>UTF-16<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-2.png\" alt=\"\" class=\"wp-image-120\" width=\"367\" height=\"176\" srcset=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-2.png 954w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-2-300x144.png 300w, https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image-2-768x369.png 768w\" sizes=\"auto, (max-width: 367px) 100vw, 367px\" \/><figcaption>Unicode Scalar<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The Swift Programming Language (Swift 5.1) \uc5d0\uc11c Strings and Characters \uc5d0\uc11c \uc911\uc694\ud558\ub2e4\uace0 \uc0dd\uac01\ub418\ub294 \ubd80\ubd84\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4. &#8211; String, Character\ub294 \uad6c\uc870\uccb4\uc774\ub2e4&#8211; Character\uc758 \uc5f0\uc18d\uc774 String\uc774\ub2e4&#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[24,18,17,21,25],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-swift","tag-character","tag-string","tag-swift","tag-21","tag-25"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd<\/title>\n<meta name=\"description\" content=\"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.daymore.com\/?p=112\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd\" \/>\n<meta property=\"og:description\" content=\"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.daymore.com\/?p=112\" \/>\n<meta property=\"og:site_name\" content=\"\uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-22T15:10:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-03T12:56:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png\" \/>\n<meta name=\"author\" content=\"daymore\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"daymore\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.daymore.com\/?p=112\",\"url\":\"https:\/\/blog.daymore.com\/?p=112\",\"name\":\"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd\",\"isPartOf\":{\"@id\":\"https:\/\/blog.daymore.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.daymore.com\/?p=112#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.daymore.com\/?p=112#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png\",\"datePublished\":\"2020-01-22T15:10:47+00:00\",\"dateModified\":\"2020-02-03T12:56:32+00:00\",\"author\":{\"@id\":\"https:\/\/blog.daymore.com\/#\/schema\/person\/d2a6b2e27e0ca7aa5736172b432c1763\"},\"description\":\"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.daymore.com\/?p=112#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.daymore.com\/?p=112\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/blog.daymore.com\/?p=112#primaryimage\",\"url\":\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png\",\"contentUrl\":\"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png\",\"width\":953,\"height\":458},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.daymore.com\/?p=112#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.daymore.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.daymore.com\/#website\",\"url\":\"https:\/\/blog.daymore.com\/\",\"name\":\"\uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd\",\"description\":\"blog.daymore.com\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.daymore.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.daymore.com\/#\/schema\/person\/d2a6b2e27e0ca7aa5736172b432c1763\",\"name\":\"daymore\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/blog.daymore.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f7c8fbf7472c334702e25bab1089b35096ea0daf226ea3e22f66568aba3570e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f7c8fbf7472c334702e25bab1089b35096ea0daf226ea3e22f66568aba3570e6?s=96&d=mm&r=g\",\"caption\":\"daymore\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd","description":"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4","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:\/\/blog.daymore.com\/?p=112","og_locale":"ko_KR","og_type":"article","og_title":"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd","og_description":"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4","og_url":"https:\/\/blog.daymore.com\/?p=112","og_site_name":"\uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd","article_published_time":"2020-01-22T15:10:47+00:00","article_modified_time":"2020-02-03T12:56:32+00:00","og_image":[{"url":"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png","type":"","width":"","height":""}],"author":"daymore","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"daymore","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.daymore.com\/?p=112","url":"https:\/\/blog.daymore.com\/?p=112","name":"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30 - \uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd","isPartOf":{"@id":"https:\/\/blog.daymore.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.daymore.com\/?p=112#primaryimage"},"image":{"@id":"https:\/\/blog.daymore.com\/?p=112#primaryimage"},"thumbnailUrl":"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png","datePublished":"2020-01-22T15:10:47+00:00","dateModified":"2020-02-03T12:56:32+00:00","author":{"@id":"https:\/\/blog.daymore.com\/#\/schema\/person\/d2a6b2e27e0ca7aa5736172b432c1763"},"description":"Swift String, Character \uc5d0 \ub300\ud574\uc11c \uc0b4\ud3b4\ubcf4\uace0 \uc911\uc694\ud55c \uc0ac\ud56d\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4","breadcrumb":{"@id":"https:\/\/blog.daymore.com\/?p=112#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.daymore.com\/?p=112"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/blog.daymore.com\/?p=112#primaryimage","url":"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png","contentUrl":"https:\/\/blog.daymore.com\/wp-content\/uploads\/2020\/01\/image.png","width":953,"height":458},{"@type":"BreadcrumbList","@id":"https:\/\/blog.daymore.com\/?p=112#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.daymore.com\/"},{"@type":"ListItem","position":2,"name":"Swift String, Character \uc0b4\ud3b4 \ubcf4\uae30"}]},{"@type":"WebSite","@id":"https:\/\/blog.daymore.com\/#website","url":"https:\/\/blog.daymore.com\/","name":"\uae00\uc4f0\uae30, IT \uc791\uc740 \uc9c0\uc2dd","description":"blog.daymore.com","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.daymore.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/blog.daymore.com\/#\/schema\/person\/d2a6b2e27e0ca7aa5736172b432c1763","name":"daymore","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/blog.daymore.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f7c8fbf7472c334702e25bab1089b35096ea0daf226ea3e22f66568aba3570e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f7c8fbf7472c334702e25bab1089b35096ea0daf226ea3e22f66568aba3570e6?s=96&d=mm&r=g","caption":"daymore"}}]}},"_links":{"self":[{"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":17,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":156,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions\/156"}],"wp:attachment":[{"href":"https:\/\/blog.daymore.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.daymore.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}