{"id":369,"date":"2014-08-28T16:04:11","date_gmt":"2014-08-28T07:04:11","guid":{"rendered":"http:\/\/gomocool.net\/gomokulog\/?p=369"},"modified":"2016-06-23T18:14:19","modified_gmt":"2016-06-23T09:14:19","slug":"net-%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e6%96%87%e5%ad%97%e5%88%97%e3%81%a7split","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=369","title":{"rendered":"[.NET] \u6587\u5b57\u5217\u3092\u6587\u5b57\u5217\u3067Split"},"content":{"rendered":"<p>C#\u3084VB.NET\u3067\u3001\u300c\u6587\u5b57\u5217\u3092\u6587\u5b57\u5217\u3067\u5206\u5272\u300d\u3057\u305f\u3044\u5834\u5408\u3001\u5c11\u3057\u7279\u6b8a\u306a\u66f8\u304d\u65b9\u306b\u306a\u308b\u3002<\/p>\n<p>\u6587\u5b57\u5217\u3092\u300c\u6587\u5b57\u300d\u3067\u5206\u5272\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u305d\u3093\u306a\u306b\u8003\u3048\u306a\u3044\u304c\u3001\u300c\u6587\u5b57\u5217\u300d\u306e\u5834\u5408\u306f\u3001\u914d\u5217\u306b\u5165\u308c\u3066\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>C#\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3002<\/p>\n<pre class=\"lang:c# decode:true\">var msg = \"Microsoft###Google###Apple\";\r\nvar msgs = msg.Split(new string[]{\"###\"}, System.StringSplitOptions.None);<\/pre>\n<p>VB\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304f\u304b\u3001\u5f8c\u8ff0\u3059\u308bSplit\u95a2\u6570\u3092\u4f7f\u3046\u3002<\/p>\n<pre class=\"lang:vbnet decode:true\">Dim msg As String = \"Microsoft###Google###Apple\"\r\nDim msgs As String() = msg.Split(New String() {\"###\"}, StringSplitOptions.None)<\/pre>\n<p>\u304a\u305d\u3089\u304f\u306f\u3001\u3053\u306e\u306e\u3084\u308a\u65b9\u3067\u307b\u3068\u3093\u3069\u4e8b\u8db3\u308a\u308b\u3068\u601d\u3046\u3002<\/p>\n<p>VB\u306e\u5834\u5408\u3001\u3084\u3084<span style=\"color: #ff0000;\">\u6ce8\u610f<\/span>\u304c\u5fc5\u8981\u3002<br \/>\n\u4f55\u3082\u8003\u3048\u305a\u306b\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304f\u3068\u3001\u00a0\u5148\u982d\u6587\u5b57\u3060\u3051\u3092\u30c7\u30ea\u30df\u30bf\u3068\u3057\u3066\u3001\u901a\u5e38\u306f3\u3064\u306b\u5206\u5272\u3057\u3066\u307b\u3057\u3044\u3068\u3053\u308d\u3060\u304c\u3001#\u4e00\u3064\u306b\u3064\u3044\u3066\u5206\u5272\u3059\u308b\u306e\u3067\u30017\u3064\u306b\u5206\u5272\u3055\u308c\u308b\u3002<br \/>\nC#\u3060\u3068\u3001\u6012\u3089\u308c\u308b\u306e\u3067\u3001\u305d\u306e\u5fc3\u914d\u306f\u306a\u3044\u3002<\/p>\n<pre class=\"lang:vbnet decode:true\">Dim msg As String = \"Microsoft###Google###Apple\"; \r\nDim msgs As String() = msg.Split(\"###\");<\/pre>\n<h4>\u8907\u6570\u306e\u30c7\u30ea\u30df\u30bf<\/h4>\n<p>\u3061\u306a\u307f\u306b\u3001\u914d\u5217\u306b\u6587\u5b57\u5217\u3092\u8907\u6570\u5165\u308c\u308c\u3070\u3001\u305d\u308c\u3089\u304c\u3059\u3079\u3066\u30c7\u30ea\u30df\u30bf\u306b\u306a\u308a\u3001\u3069\u308c\u304b\u4e00\u3064\u3067\u3082\u3042\u308c\u3070\u5206\u5272\u3055\u308c\u308b\u3002<br \/>\n\u307e\u305f\u3001\u5f8c\u308d\u306b\u3064\u3051\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306fNone\u4ee5\u5916\u306b\u3082RemoveEmptyEntries\u304c\u9078\u3079\u3001\u3053\u308c\u306f\u3001\u6587\u5b57\u5217\u304c\u7a7a\u306e\u5834\u5408\u306b\u914d\u5217\u3092\u8fd4\u3055\u306a\u304f\u306a\u308b\u3002<\/p>\n<pre class=\"lang:c# decode:true\">var msgs = msg.Split(new string[]{\"@@@\",\"###\"}, StringSplitOptions.RemoveEmptyEntries);<\/pre>\n<p>\u4ed6\u306b\u3001\u8fd4\u308b\u914d\u5217\u6570\u3092\u9650\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3060\u3063\u305f\u308a\u3001\u8907\u6570\u306e\u6587\u5b57\u5217\u3067\u5206\u89e3\u3059\u308b\u5834\u5408\u306e\u30d2\u30c3\u30c8\u3059\u308b\u9806\u756a\u306e\u4ed5\u69d8({&#8220;a&#8221;,&#8221;ab&#8221;}\u3060\u3068\u3069\u3046\u306a\u308b\u306e\u304b\u7b49)\u3068\u304b\u306f\u3001<a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/library\/tabh47cf(v=vs.110).aspx\" target=\"_blank\">MSDN<\/a>\u3067\u3002<\/p>\n<h4>Split\u95a2\u6570<\/h4>\n<p>Visual Basic \u306b\u306fSplit\u95a2\u6570\u304c\u3042\u308a\u3001\u3053\u3063\u3061\u306f\u666e\u901a\u306b\u6587\u5b57\u5217\u3001\u6587\u5b57\u5217\u3060\u3051\u3067\u5206\u5272\u3057\u3066\u304f\u308c\u308b\u3002<br \/>\nVB\u306f\u7d20\u76f4\u306b\u3053\u3061\u3089\u3092\u4f7f\u3063\u3066\u3044\u305f\u307b\u3046\u304c\u7121\u96e3\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u7684\u306b\u306f\u5c11\u3057\u6c17\u6301\u3061\u60aa\u3044\u304c\u30fb\u30fb\u30fb\u3002<br \/>\n<span class=\"lang:vbnet decode:true  crayon-inline \">msgs = Split(msg, &#8220;###&#8221;)<\/span><\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/cc410311.aspx\" target=\"_blank\">Split\u95a2\u6570<br \/>\n<\/a>Split\u95a2\u6570\u306f\u3001VB.NET\u6a19\u6e96\u3060\u304c\u3001C#\u3067\u3082\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u53c2\u7167\u3059\u308c\u3070\u4f7f\u3048\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C#\u3084VB.NET\u3067\u3001\u300c\u6587\u5b57\u5217\u3092\u6587\u5b57\u5217\u3067\u5206\u5272\u300d\u3057\u305f\u3044\u5834\u5408\u3001\u5c11\u3057\u7279\u6b8a\u306a\u66f8\u304d\u65b9\u306b\u306a\u308b\u3002 \u6587\u5b57\u5217\u3092\u300c\u6587\u5b57\u300d\u3067\u5206\u5272\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u305d\u3093\u306a\u306b\u8003\u3048\u306a\u3044\u304c\u3001\u300c\u6587\u5b57\u5217\u300d\u306e\u5834\u5408\u306f\u3001\u914d\u5217\u306b\u5165\u308c\u3066\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002 C#\u3067\u306f\u3001\u4e0b&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=369\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,20,43],"tags":[],"class_list":["post-369","post","type-post","status-publish","format-standard","hentry","category-dot-net","category-csharp","category-visualbasic-net"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":4,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/772"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}