{"id":7240,"date":"2022-03-24T15:44:41","date_gmt":"2022-03-24T06:44:41","guid":{"rendered":"https:\/\/www.auctionpro.co.kr\/?p=7240"},"modified":"2024-02-02T15:21:05","modified_gmt":"2024-02-02T06:21:05","slug":"%ec%a4%84%eb%b0%94%ea%bf%88-newline-windows-linux","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=7240","title":{"rendered":"\uc904\ubc14\uafc8 newline  Windows \/ Linux"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Remark : Windows \uc640 Linux \uc5d0\uc11c  \uc904\ubc14\uafc8 newline \ud45c\uc2dc \ubc29\ubc95 <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Linux \ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \uc6f9\uc11c\ube44\uc2a4\uc778 \uc7a5\ubb38\uc758 \ub9ac\ud134\uac12\uc740 windows \uc904\ubc14\uafc8(CRLF) Text \uc640 \ub2e4\ub978\uac8c  LF(line Feed) \ub9cc \uc874\uc7ac <\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\uc904\ubc14\uafc8 \ubb38\uc790 <\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uc708\ub3c4\uc6b0\ub294&nbsp;<strong>CRLF(\\r\\n)<\/strong><\/li>\n\n\n\n<li>\ub9ac\ub205\uc2a4\ub294&nbsp;<strong>LF (\\n)<\/strong>&nbsp;<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">CR LF \uc815\uc758 <\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CR : Carriage Return (\\r)<\/li>\n\n\n\n<li>LF : Line Feed (\\n)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">&#8220;\\r\\n&#8221;, &#8220;\\r&#8221;, &#8220;\\n&#8221; \uac01\uac01 \ubb38\uc790 \uc790\ub9ac\uc218\ub294 \uc5b4\ub5bb\uac8c \ub418\ub098 ?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code><br>\\r<\/code>, <code>\\n<\/code>, \uadf8\ub9ac\uace0 <code>\\r\\n<\/code>\uc740 \ud14d\uc2a4\ud2b8\uc5d0\uc11c \uc904\ubc14\uafc8\uc744 \ub098\ud0c0\ub0b4\ub294 \ubb38\uc790(\ub610\ub294 \ubb38\uc790 \uc870\ud569)\uc785\ub2c8\ub2e4. \uac01\uac01\uc758 \ubb38\uc790(\ub610\ub294 \ubb38\uc790 \uc870\ud569)\uc758 \uc790\ub9ac\uc218\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\\n<\/code> (LF, Line Feed): \uc720\ub2c9\uc2a4 \ubc0f \uc720\ub2c9\uc2a4 \uacc4\uc5f4 \uc2dc\uc2a4\ud15c(\ub9ac\ub205\uc2a4, macOS \ub4f1)\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 \uc904\ubc14\uafc8 \ubb38\uc790\ub85c, 1\uc790\ub9ac\ub97c \ucc28\uc9c0\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><code>\\r<\/code> (CR, Carriage Return): \uace0\uc804 \ub9e4\ud0a8\ud1a0\uc2dc \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 \uc904\ubc14\uafc8 \ubb38\uc790\ub85c, 1\uc790\ub9ac\ub97c \ucc28\uc9c0\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><code>\\r\\n<\/code> (CRLF, Carriage Return + Line Feed): \uc708\ub3c4\uc6b0 \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 \uc904\ubc14\uafc8 \ubb38\uc790 \uc870\ud569\uc73c\ub85c, 2\uc790\ub9ac\ub97c \ucc28\uc9c0\ud569\ub2c8\ub2e4 (<code>\\r<\/code>\uacfc <code>\\n<\/code>\uc758 \uacb0\ud569).<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">c# (Linux Text to Windows)<\/h4>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \">\/\/replace sText \\n =&gt; \\r\\n\nsText = sText.Replace(\"\\n\", \"\\r\\n\");<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >using System;\nusing System.Text.RegularExpressions;\n\nclass Program\n{\n    static void Main()\n    {\n        string text = @\"\n11. BLACKOUT DATES\nNO BLACKOUT DATES APPLY.\n\n12. SURCHARGES\nNO SURCHARGE REQUIREMENTS APPLY.\n\n13. ACCOMPANIED TRAVEL\nACCOMPANIED TRAVEL NOT REQUIRED.\n\n14. TRAVEL RESTRICTIONS\nVALID FOR TRAVEL COMMENCING ON\/AFTER 01APR24 AND ON\/\nBEFORE 31MAR25.\n\n15. SALES RESTRICTIONS\nTICKETS MUST BE ISSUED ON\/AFTER 30JAN24 AND ON\/BEFORE\n31MAR25.\n\";\n        string indentedText = IndentText(text);\n        Console.WriteLine(indentedText);\n    }\n\n    static string IndentText(string text)\n    {\n        var lines = text.Split(new[] { \"\\r\\n\", \"\\r\", \"\\n\" }, StringSplitOptions.None);\n        var pattern = @\"^\\d{2}\\.\";\n\n        for (int i = 0; i &lt; lines.Length; i++)\n        {\n            if (!Regex.IsMatch(lines[i], pattern))\n            {\n                lines[i] = \" \" + lines[i];\n            }\n        }\n\n        return String.Join(Environment.NewLine, lines);\n    }\n}\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Remark : Windows \uc640 Linux \uc5d0\uc11c \uc904\ubc14\uafc8 newline \ud45c\uc2dc \ubc29\ubc95 Linux \ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \uc6f9\uc11c\ube44\uc2a4\uc778 \uc7a5\ubb38\uc758 \ub9ac\ud134\uac12\uc740 windows \uc904\ubc14\uafc8(CRLF) Text \uc640 \ub2e4\ub978\uac8c LF(line Feed) \ub9cc \uc874\uc7ac <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=7240\" title=\"\uc904\ubc14\uafc8 newline  Windows \/ Linux\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-7240","post","type-post","status-publish","format-standard","hentry","category-developer-tip"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7240"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7240\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}