{"id":18433,"date":"2026-07-19T06:01:03","date_gmt":"2026-07-18T21:01:03","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=18433"},"modified":"2026-07-19T06:01:03","modified_gmt":"2026-07-18T21:01:03","slug":"cc-js-substr-string","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-js-substr-string\/","title":{"rendered":"\u30102026\u5e747\u6708\u6700\u65b0\u3011JavaScript substr\u30fbsubstring\u30fbslice \u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u975e\u63a8\u5968\u304b\u3089\u79fb\u884c\u6cd5\u30fb\u5b9f\u52d9\u4f8b\u30fbClaude Code\u6d3b\u7528\u307e\u3067"},"content":{"rendered":"\n<style>\n.g-flow-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;align-items:center;}\n.g-flow-item{background:linear-gradient(135deg,#1a1a1a,#2a1015);color:#fff;border-radius:8px;padding:16px 14px;min-width:130px;flex:1;text-align:center;}\n.g-flow-arrow{color:#dc2626;font-size:20px;font-weight:700;}\n.g-card-row{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 32px;}\n.g-card-row>div{flex:1;min-width:220px;}\n@media(max-width:600px){\n  .g-flow-row{flex-direction:column;}\n  .g-flow-arrow{transform:rotate(90deg);}\n  .g-card-row{flex-direction:column;}\n  .g-card-row>div{min-width:100%;}\n}\n<\/style>\n\n\n\n<div style=\"margin:0 0 32px;\">\n  <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/07\/thumb-cc-js-substr-string-4.jpg\" alt=\"\u30102026\u5e747\u6708\u6700\u65b0\u3011JavaScript substr\u30fbsubstring\u30fbslice \u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u975e\u63a8\u5968\u304b\u3089\u79fb\u884c\u6cd5\u30fb\u5b9f\u52d9\u4f8b\u30fbClaude Code\u6d3b\u7528\u307e\u3067\" style=\"width:100%;height:auto;border-radius:12px;display:block;\">\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-radius:12px;padding:24px 28px;margin:0 0 32px;border-left:4px solid #f59e0b;\">\n  <p style=\"font-size:15px;font-weight:700;color:#1a1a1a;margin:0 0 16px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9<\/p>\n  <ol style=\"margin:0;padding-left:20px;font-size:14px;line-height:2.2;list-style:none;\">\n    <li><a href=\"#sec-01\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">01<\/span>substr\u30fbsubstring\u30fbslice\u306e\u9055\u3044\u3092\u5148\u306b\u628a\u63e1\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-02\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">02<\/span>substr()\u306e\u4f7f\u3044\u65b9\uff08\u975e\u63a8\u5968\uff09\u3068deprecation\u7406\u7531<\/a><\/li>\n    <li><a href=\"#sec-03\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">03<\/span>substring()\u306e\u4f7f\u3044\u65b9\u3068\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u843d\u3068\u3057\u7a74<\/a><\/li>\n    <li><a href=\"#sec-04\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">04<\/span>slice()\u306e\u4f7f\u3044\u65b9\uff5c\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6700\u3082\u76f4\u611f\u7684<\/a><\/li>\n    <li><a href=\"#sec-05\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">05<\/span>3\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u30fb\u6319\u52d5\u3092\u5b8c\u5168\u6bd4\u8f03<\/a><\/li>\n    <li><a href=\"#sec-06\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">06<\/span>\u65e5\u672c\u8a9e\u30fbUnicode\u30fb\u7d75\u6587\u5b57\u3092\u6b63\u3057\u304f\u6271\u3046\u65b9\u6cd5<\/a><\/li>\n    <li><a href=\"#sec-07\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">07<\/span>\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u5225\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30b3\u30fc\u30c9\u96c6<\/a><\/li>\n    <li><a href=\"#sec-08\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">08<\/span>at()\u30fbsplit()\u30fb\u6b63\u898f\u8868\u73fe\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/a><\/li>\n    <li><a href=\"#sec-09\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">09<\/span>Claude Code\u3067\u6587\u5b57\u5217\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b<\/a><\/li>\n    <li><a href=\"#faq\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#f59e0b;font-weight:700;margin-right:8px;\">FAQ<\/span>\u3088\u304f\u3042\u308b\u8cea\u554f<\/a><\/li>\n  <\/ol>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript\u3067\u6587\u5b57\u5217\u3092\u5207\u308a\u51fa\u3059\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u3068\u300csubstr\u30fbsubstring\u30fbslice\u300d\u306e3\u3064\u304c\u51fa\u3066\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u9055\u3044\u304c\u5206\u304b\u3089\u306a\u304f\u3066\u3001\u3068\u308a\u3042\u3048\u305a\u52d5\u3044\u305f\u65b9\u6cd5\u3092\u4f7f\u3044\u7d9a\u3051\u3066\u3044\u308b\u65b9\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u306f<strong>substr()\u306f\u73fe\u5728\u975e\u63a8\u5968\uff08deprecated\uff09<\/strong>\u3067\u3042\u308a\u3001\u5c06\u6765\u7684\u306b\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001\u591a\u304f\u306e\u89e3\u8aac\u8a18\u4e8b\u304c\u3044\u307e\u3060\u306b\u975e\u63a8\u5968\u306e substr \u3092\u4e2d\u5fc3\u306b\u89e3\u8aac\u3057\u3066\u3044\u308b\u306e\u304c\u73fe\u72b6\u3067\u3059\u3002\u4eca\u5f8c\u306f<strong>slice()\u304bsubstring()\u3092\u4f7f\u3046\u306e\u304c\u6b63\u3057\u3044\u9078\u629e<\/strong>\u3067\u3042\u308a\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306f\u305d\u306e\u7406\u7531\u3068\u4f7f\u3044\u65b9\u3092\u5fb9\u5e95\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300csubstr\u3092\u6559\u3048\u3066\u3082\u3089\u3063\u3066\u30b3\u30fc\u30c9\u306b\u4f7f\u3063\u3066\u3057\u307e\u3063\u305f\u300d\u3068\u3044\u3046\u65b9\u3082\u5927\u4e08\u592b\u3067\u3059\u3002\u65e2\u5b58\u30b3\u30fc\u30c9\u3092 slice \u306b\u79fb\u884c\u3059\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u66f8\u304d\u63db\u3048\u30d1\u30bf\u30fc\u30f3\u3082\u7d39\u4ecb\u3059\u308b\u306e\u3067\u3001\u65e2\u5b58\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5bfe\u5fdc\u306b\u3082\u4f7f\u3048\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">slice\u30fbsubstring\u30fbsubstr\u306f\u898b\u305f\u76ee\u304c\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u5f15\u6570\u306e\u610f\u5473\u3068\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u6271\u3044\u304c\u307e\u3063\u305f\u304f\u7570\u306a\u308a\u307e\u3059\u3002\u7279\u306b\u300c\u30de\u30a4\u30ca\u30b9\u3092\u6307\u5b9a\u3057\u305f\u3089\u6319\u52d5\u304c\u5909\u308f\u3063\u305f\u300d\u3068\u3044\u3046\u7d4c\u9a13\u304c\u3042\u308b\u65b9\u306f\u3001Section5\u306e\u6bd4\u8f03\u8868\u3092\u5148\u306b\u898b\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>substr\u30fbsubstring\u30fbslice\u306e<strong>\u5f15\u6570\u306e\u610f\u5473\u306e\u9055\u3044<\/strong>\uff08\u6587\u5b57\u6570\u6307\u5b9a vs \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>substr()\u304c\u975e\u63a8\u5968<\/strong>\u306b\u306a\u3063\u305f\u7406\u7531\u3068\u3001\u4eca\u5f8c\u306e\u79fb\u884c\u5148<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>3\u30e1\u30bd\u30c3\u30c9\u3067<strong>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u6319\u52d5\u304c\u7570\u306a\u308b<\/strong>\u70b9\u3068\u5bfe\u51e6\u6cd5<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u65e5\u672c\u8a9e\u30fb\u7d75\u6587\u5b57\uff08Unicode\uff09\u3092<strong>\u6b63\u3057\u304f\u5207\u308a\u51fa\u3059\u65b9\u6cd5<\/strong><\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>URL\u89e3\u6790\u30fb\u30c6\u30ad\u30b9\u30c8\u5207\u308a\u6368\u3066\u306a\u3069<strong>\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/strong>\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30b3\u30fc\u30c9<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Claude Code<\/strong>\u3067\u6587\u5b57\u5217\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3055\u305b\u308b\u65b9\u6cd5<\/span><\/div>\n\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-01\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">01<\/span>\n  <span class=\"section-label\" style=\"display:block;\">OVERVIEW<\/span>\n  <span class=\"section-title\" style=\"display:block;\">substr\u30fbsubstring\u30fbslice\u306e\u9055\u3044\u3092\u5148\u306b\u628a\u63e1\u3059\u308b<\/span>\n  <span class=\"section-desc\">3\u3064\u306e\u5f15\u6570\u69cb\u9020\u3068\u63a8\u5968\u5ea6\u306e\u6bd4\u8f03<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a3\u30e1\u30bd\u30c3\u30c9\u306e\u69cb\u6587\u3092\u4e26\u3079\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002\u3053\u306e\u9055\u3044\u3092\u6700\u521d\u306b\u62bc\u3055\u3048\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u5f8c\u306e\u8a73\u7d30\u8aac\u660e\u304c\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ 3\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u69cb\u6587\u6bd4\u8f03\nconst str = \"Hello World\";\n\n\/\/ \u2460 substring(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9) \u2190 \u63a8\u5968\nstr.substring(0, 5)  \/\/ \u2192 \"Hello\"   \uff080\u756a\u76ee\u304b\u30895\u756a\u76ee\u306e\u76f4\u524d\u307e\u3067\uff09\n\n\/\/ \u2461 slice(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9) \u2190 \u63a8\u5968\uff08\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u53ef\uff09\nstr.slice(0, 5)      \/\/ \u2192 \"Hello\"   \uff08substr\u3068\u307b\u307c\u540c\u3058\u52d5\u4f5c\uff09\nstr.slice(-5)        \/\/ \u2192 \"World\"   \uff08\u672b\u5c3e\u304b\u30895\u6587\u5b57\uff09\n\n\/\/ \u2462 substr(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u6587\u5b57\u6570) \u2190 \u975e\u63a8\u5968\uff01\nstr.substr(0, 5)     \/\/ \u2192 \"Hello\"   \uff080\u756a\u76ee\u304b\u30895\u6587\u5b57\u5206\uff09<\/pre>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30e1\u30bd\u30c3\u30c9<\/th><th>\u7b2c1\u5f15\u6570<\/th><th>\u7b2c2\u5f15\u6570<\/th><th>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/th><th>\u63a8\u5968\u5ea6<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>substring()<\/td><td>\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/td><td>\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u542b\u307e\u306a\u3044\uff09<\/td><td>0\u3068\u3057\u3066\u6271\u3046\uff08\u6ce8\u610f\uff09<\/td><td>\u25ce \u63a8\u5968<\/td><\/tr>\n<tr><td>slice()<\/td><td>\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/td><td>\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u542b\u307e\u306a\u3044\uff09<\/td><td>\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\uff08\u76f4\u611f\u7684\uff09<\/td><td>\u25ce \u63a8\u5968<\/td><\/tr>\n<tr><td>substr()<\/td><td>\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/td><td>\u5207\u308a\u51fa\u3059\u6587\u5b57\u6570<\/td><td>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u53ef\uff08\u4e00\u90e8\uff09<\/td><td>\u00d7 \u975e\u63a8\u5968\uff08deprecated\uff09<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08Index\uff09<\/strong>\uff1a\u6587\u5b57\u5217\u306e\u5404\u6587\u5b57\u306e\u4f4d\u7f6e\u756a\u53f7\u3002JavaScript\u3067\u306f0\u304b\u3089\u59cb\u307e\u308b\u3002\"Hello\"\u306e\u5834\u5408\u3001H=0\u3001e=1\u3001l=2\u3001l=3\u3001o=4\u3002\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u3001\u305d\u306e\u4f4d\u7f6e\u306e\u6587\u5b57\u306f\u542b\u307e\u308c\u306a\u3044\uff08\"Hello\".slice(0,3) \u2192 \"Hel\"\u30013\u756a\u76ee\u306el\u306f\u542b\u307e\u308c\u306a\u3044\uff09\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">\u8ff7\u3063\u305f\u3089slice()\u3092\u4f7f\u3046<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">3\u3064\u306e\u3046\u3061\u3069\u308c\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u8ff7\u3046\u5834\u9762\u3067\u306f\u3001slice()\u3092\u9078\u3079\u3070\u9593\u9055\u3044\u3042\u308a\u307e\u305b\u3093\u3002substr\u3068\u540c\u3058\u304f\u958b\u59cb\u4f4d\u7f6e\u304b\u3089\u306e\u6307\u5b9a\u304c\u76f4\u611f\u7684\u3067\u3001\u304b\u3064\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u81ea\u7136\u306b\u4f7f\u3048\u3001\u975e\u63a8\u5968\u3067\u3082\u306a\u3044\u3002substring()\u306f\u5f15\u6570\u306e\u9806\u5e8f\u304c\u9006\u8ee2\u3059\u308b\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u304c\u3042\u308b\u305f\u3081\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u4f7f\u3046\u306a\u3089slice\u306e\u65b9\u304c\u5b89\u5168\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-02\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">02<\/span>\n  <span class=\"section-label\" style=\"display:block;\">DEPRECATED<\/span>\n  <span class=\"section-title\" style=\"display:block;\">substr()\u306e\u4f7f\u3044\u65b9\uff08\u975e\u63a8\u5968\uff09\u3068deprecation\u7406\u7531<\/span>\n  <span class=\"section-desc\">\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u7406\u89e3\u306e\u305f\u3081\u306b\u77e5\u3063\u3066\u304a\u304f\u3002\u65b0\u898f\u306fslice()\u306b\u79fb\u884c\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">substr()\u306f\u975e\u63a8\u5968\uff08deprecated\uff09\u3067\u3059<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">MDN Web Docs\u3067\u306f substr() \u306f\u300cWeb\u6a19\u6e96\u304b\u3089\u524a\u9664\u3055\u308c\u308b\u4e88\u5b9a\uff08deprecated\uff09\u300d\u3068\u660e\u8a18\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u53e4\u3044\u30b3\u30fc\u30c9\u306e\u8aad\u89e3\u306b\u306f\u5f79\u7acb\u3061\u307e\u3059\u304c\u3001\u65b0\u898f\u30b3\u30fc\u30c9\u3067substr()\u3092\u66f8\u304f\u3053\u3068\u306f\u63a8\u5968\u3057\u307e\u305b\u3093\u3002slice() \u307e\u305f\u306f substring() \u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">substr()\u306e\u69cb\u6587\u306f <code>str.substr(start, length)<\/code> \u3067\u3059\u3002\u7b2c2\u5f15\u6570\u304c\u300c\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u3067\u306f\u306a\u304f<strong>\u300c\u5207\u308a\u51fa\u3059\u6587\u5b57\u6570\u300d<\/strong>\u3067\u3042\u308b\u70b9\u304csubstring\u3084slice\u3068\u306e\u6700\u5927\u306e\u9055\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">const str = \"Hello World\";\n\/\/            01234567890  \u2190 \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\n\n\/\/ \u57fa\u672c: substr(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u6587\u5b57\u6570)\nstr.substr(0, 5)   \/\/ \u2192 \"Hello\"    \uff080\u756a\u76ee\u304b\u30895\u6587\u5b57\uff09\nstr.substr(6, 5)   \/\/ \u2192 \"World\"    \uff086\u756a\u76ee\u304b\u30895\u6587\u5b57\uff09\nstr.substr(6)      \/\/ \u2192 \"World\"    \uff08\u7b2c2\u5f15\u6570\u7701\u7565=\u672b\u5c3e\u307e\u3067\uff09\n\n\/\/ \u8ca0\u306e\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\uff09\nstr.substr(-5)     \/\/ \u2192 \"World\"    \uff08\u672b\u5c3e\u304b\u30895\u6587\u5b57\uff09\nstr.substr(-5, 3)  \/\/ \u2192 \"Wor\"      \uff08\u672b\u5c3e\u304b\u30895\u6587\u5b57\u76ee\u3092\u8d77\u70b9\u306b3\u6587\u5b57\uff09\n\n\/\/ \u7b2c2\u5f15\u6570\u304c0\u307e\u305f\u306f\u8ca0\u6570\u306e\u5834\u5408\nstr.substr(0, 0)   \/\/ \u2192 \"\"         \uff08\u7a7a\u6587\u5b57\u5217\uff09\nstr.substr(0, -1)  \/\/ \u2192 \"\"         \uff08\u8ca0\u6570\u306e\u6587\u5b57\u6570\u306f\u7a7a\u6587\u5b57\u5217\uff09<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">substr()\u304cdeprecated\u306b\u306a\u3063\u305f\u7406\u7531<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">substr()\u304c\u975e\u63a8\u5968\u306b\u306a\u3063\u305f\u7406\u7531\u306f\u4e3b\u306b2\u70b9\u3067\u3059\u3002\u2460<strong>\u4ed6\u306e\u8a00\u8a9e\u3068\u5f15\u6570\u306e\u610f\u5473\u304c\u7570\u306a\u308b\u305f\u3081\u6df7\u4e71\u3092\u62db\u304f<\/strong>\uff08\u591a\u304f\u306e\u8a00\u8a9e\u3067\u306f\u300c\u958b\u59cb\u4f4d\u7f6e, \u7d42\u4e86\u4f4d\u7f6e\u300d\u304c\u6a19\u6e96\u7684\uff09\u3002\u2461<strong>substring\u3068slice\u3067\u540c\u7b49\u306e\u6a5f\u80fd\u304c\u63d0\u4f9b\u3055\u308c\u3066\u304a\u308a\u3001substr\u56fa\u6709\u306e\u5229\u70b9\u304c\u307b\u307c\u306a\u3044<\/strong>\u305f\u3081\u3002ECMAScript\u4ed5\u69d8\u3067\u3082\u300cAnnex B\uff08\u65e7\u5f62\u5f0f\u306e\u6a5f\u80fd\uff09\u300d\u306b\u5206\u985e\u3055\u308c\u3066\u304a\u308a\u3001\u5c06\u6765\u306e\u30d6\u30e9\u30a6\u30b6\u3084Node.js\u3067\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ substr\u304b\u3089slice\u3078\u306e\u79fb\u884c\u30d1\u30bf\u30fc\u30f3\n\/\/ substr(start, length) \u2192 slice(start, start + length)\n\n\/\/ Before (\u975e\u63a8\u5968)\nstr.substr(3, 5)\n\n\/\/ After (\u63a8\u5968)\nstr.slice(3, 3 + 5)  \/\/ = str.slice(3, 8)\n\n\/\/ \u7b2c2\u5f15\u6570\u306a\u3057\uff08\u672b\u5c3e\u307e\u3067\uff09\u306e\u5834\u5408\nstr.substr(3)       \/\/ Before\nstr.slice(3)        \/\/ After\uff08\u540c\u3058\u66f8\u304d\u65b9\u3067OK\uff09\n\n\/\/ \u8ca0\u306e\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u5834\u5408\nstr.substr(-5)      \/\/ Before\nstr.slice(-5)       \/\/ After\uff08\u540c\u3058\u66f8\u304d\u65b9\u3067OK\uff09<\/pre>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-03\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">03<\/span>\n  <span class=\"section-label\" style=\"display:block;\">SUBSTRING<\/span>\n  <span class=\"section-title\" style=\"display:block;\">substring()\u306e\u4f7f\u3044\u65b9\u3068\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u843d\u3068\u3057\u7a74<\/span>\n  <span class=\"section-desc\">substr\u3068\u6df7\u540c\u3057\u3084\u3059\u3044\u7b2c2\u5f15\u6570\u306e\u610f\u5473\u3068\u7279\u6b8a\u6319\u52d5<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">substring()\u306e\u69cb\u6587\u306f <code>str.substring(start, end)<\/code> \u3067\u3059\u3002\u7b2c2\u5f15\u6570\u306f\u300c\u6587\u5b57\u6570\u300d\u3067\u306f\u306a\u304f<strong>\u300c\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u305d\u306e\u4f4d\u7f6e\u306e\u6587\u5b57\u3092\u542b\u307e\u306a\u3044\uff09\u300d<\/strong>\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">const str = \"Hello World\";\n\/\/            01234567890\n\n\/\/ \u57fa\u672c: substring(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9)\nstr.substring(0, 5)    \/\/ \u2192 \"Hello\"    \uff080\u301c4\u756a\u76ee\u307e\u3067\u30015\u756a\u76ee\u3092\u542b\u307e\u306a\u3044\uff09\nstr.substring(6, 11)   \/\/ \u2192 \"World\"    \uff086\u301c10\u756a\u76ee\u307e\u3067\uff09\nstr.substring(6)       \/\/ \u2192 \"World\"    \uff08\u7b2c2\u5f15\u6570\u7701\u7565=\u672b\u5c3e\u307e\u3067\uff09\n\n\/\/ \u2605 \u7279\u6b8a\u6319\u52d5\u2460: \u5f15\u6570\u304c\u9006\u8ee2\u3057\u305f\u5834\u5408\u306f\u81ea\u52d5\u7684\u306b\u30b9\u30ef\u30c3\u30d7\nstr.substring(5, 0)    \/\/ \u2192 \"Hello\"    \uff08substring\u306f(0,5)\u3068\u3057\u3066\u51e6\u7406\u3059\u308b\uff09\n\n\/\/ \u2605 \u7279\u6b8a\u6319\u52d5\u2461: \u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f 0 \u3068\u3057\u3066\u6271\u308f\u308c\u308b\nstr.substring(-3, 5)   \/\/ \u2192 \"Hello\"    \uff08-3\u306f0\u3068\u3057\u3066\u6271\u308f\u308c\u3001(0,5)\u3068\u540c\u3058\uff09\nstr.substring(3, -1)   \/\/ \u2192 \"Hel\"      \uff08-1\u306f0\u6271\u3044\u3001(0,3)\u306b\u30b9\u30ef\u30c3\u30d7\uff09<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">substring\u306e\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f0\u3068\u3057\u3066\u6271\u308f\u308c\u308b\uff01<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">substring()\u3067\u306f\u3001\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u305d\u306e\u307e\u307e\u300c\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u300d\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002-5\u3092\u6e21\u3057\u3066\u3082\u672b\u5c3e\u304b\u30895\u6587\u5b57\u524d\u3067\u306f\u306a\u304f\u30010\uff08\u5148\u982d\uff09\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002\u672b\u5c3e\u304b\u3089\u306e\u76f8\u5bfe\u4f4d\u7f6e\u3067\u5207\u308a\u51fa\u3057\u305f\u3044\u5834\u5408\u306f slice() \u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u64cd\u4f5c<\/th><th>substring()<\/th><th>slice()\uff08\u53c2\u8003\uff09<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u672b\u5c3e\u304b\u30895\u6587\u5b57<\/td><td>substring(str.length - 5)\uff08\u9577\u3055\u304b\u3089\u8a08\u7b97\u304c\u5fc5\u8981\uff09<\/td><td>slice(-5)\uff08\u76f4\u611f\u7684\uff09<\/td><\/tr>\n<tr><td>\u5f15\u6570\u304c\u9006\u8ee2\u3057\u305f\u3068\u304d<\/td><td>\u81ea\u52d5\u30b9\u30ef\u30c3\u30d7\u3057\u3066\u51e6\u7406\uff08\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\uff09<\/td><td>\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3059<\/td><\/tr>\n<tr><td>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/td><td>0\u3068\u3057\u3066\u6271\u3046<\/td><td>\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u3068\u3057\u3066\u6271\u3046<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>substring()\u306e\u5f15\u6570\u30b9\u30ef\u30c3\u30d7\u4ed5\u69d8<\/strong>\uff1astr.substring(start, end) \u3067 start > end \u306e\u5834\u5408\uff08\u4f8b: substring(8, 3)\uff09\u3001JavaScript\u306f\u81ea\u52d5\u7684\u306b\u5f15\u6570\u3092\u5165\u308c\u66ff\u3048\u3066substring(3, 8)\u3068\u3057\u3066\u51e6\u7406\u3059\u308b\u3002\u30a8\u30e9\u30fc\u306f\u767a\u751f\u3057\u306a\u3044\u304c\u3001\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002slice\u306f\u540c\u3058\u72b6\u6cc1\u3067\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-04\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">04<\/span>\n  <span class=\"section-label\" style=\"display:block;\">SLICE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">slice()\u306e\u4f7f\u3044\u65b9\uff5c\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6700\u3082\u76f4\u611f\u7684<\/span>\n  <span class=\"section-desc\">3\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u3067\u6700\u3082\u67d4\u8edf\u3067\u63a8\u5968\u3055\u308c\u308bslice()\u306e\u5b8c\u5168\u89e3\u8aac<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">slice()\u306e\u69cb\u6587\u306f <code>str.slice(start, end)<\/code> \u3067\u3059\u3002substring\u3068\u540c\u3058\u304f\u7b2c2\u5f15\u6570\u306f\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059\u304c\u3001<strong>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u300c\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u300d\u3068\u3057\u3066\u6b63\u3057\u304f\u6271\u3046<\/strong>\u70b9\u304c\u6700\u5927\u306e\u9055\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">const str = \"Hello World\";\n\/\/            01234567890   (\u6b63\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9)\n\/\/          -11-10-9-8-7-6-5-4-3-2-1  (\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9)\n\n\/\/ \u57fa\u672c: slice(\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9)\nstr.slice(0, 5)     \/\/ \u2192 \"Hello\"    \uff080\u301c4\u756a\u76ee\u307e\u3067\uff09\nstr.slice(6, 11)    \/\/ \u2192 \"World\"    \uff086\u301c10\u756a\u76ee\u307e\u3067\uff09\nstr.slice(6)        \/\/ \u2192 \"World\"    \uff08\u7b2c2\u5f15\u6570\u7701\u7565=\u672b\u5c3e\u307e\u3067\uff09\n\n\/\/ \u8ca0\u306e\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u672b\u5c3e\u304b\u3089\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\uff09\nstr.slice(-5)       \/\/ \u2192 \"World\"    \uff08\u672b\u5c3e\u304b\u30895\u6587\u5b57\uff09\nstr.slice(-5, -2)   \/\/ \u2192 \"Wor\"      \uff08\u672b\u5c3e\u304b\u30895\u6587\u5b57\u76ee\u301c\u672b\u5c3e\u304b\u30892\u6587\u5b57\u76ee\u306e\u76f4\u524d\uff09\nstr.slice(-5, 9)    \/\/ \u2192 \"Wo\"       \uff08\u8ca0\u3068\u6b63\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u6df7\u5728\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\uff09\n\n\/\/ \u958b\u59cb > \u7d42\u4e86\u306e\u5834\u5408\uff08substr\u3068\u306f\u7570\u306a\u308a\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3059\uff09\nstr.slice(5, 0)     \/\/ \u2192 \"\"         \uff08\u30b9\u30ef\u30c3\u30d7\u3055\u308c\u306a\u3044\u3001\u7a7a\u6587\u5b57\u5217\uff09\nstr.slice(-1, -5)   \/\/ \u2192 \"\"         \uff08\u7d42\u4e86\u304c\u958b\u59cb\u3088\u308a\u524d\u3001\u7a7a\u6587\u5b57\u5217\uff09<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">slice()\u306f\u914d\u5217\u306b\u3082\u540c\u3058\u30b7\u30b0\u30cd\u30c1\u30e3\u3067\u4f7f\u3048\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">JavaScript\u306eArray.prototype.slice()\u3082String.prototype.slice()\u3068\u5168\u304f\u540c\u3058\u30b7\u30b0\u30cd\u30c1\u30e3\uff08\u5f15\u6570\u306e\u69cb\u9020\uff09\u3092\u6301\u3061\u307e\u3059\u3002\u6587\u5b57\u5217\u306eslice\u3092\u899a\u3048\u308c\u3070\u914d\u5217\u306eslice\u3082\u540c\u3058\u611f\u899a\u3067\u4f7f\u3048\u308b\u305f\u3081\u3001\u4e00\u5ea6\u7406\u89e3\u3059\u308c\u3070\u5fdc\u7528\u7bc4\u56f2\u304c\u5e83\u3044\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>str.slice(0, 5)<\/strong><br><span style=\"font-size:12px;\">\"Hello\"<br>\uff08\u6b63\u2192\u6b63\uff09<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>str.slice(-5)<\/strong><br><span style=\"font-size:12px;\">\"World\"<br>\uff08\u8ca0\u2192\u672b\u5c3e\uff09<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>str.slice(-5, -2)<\/strong><br><span style=\"font-size:12px;\">\"Wor\"<br>\uff08\u8ca0\u2192\u8ca0\uff09<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>str.slice(3, -1)<\/strong><br><span style=\"font-size:12px;\">\"lo Worl\"<br>\uff08\u6b63\u2192\u8ca0\u6df7\u5728\uff09<\/span><\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-05\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">05<\/span>\n  <span class=\"section-label\" style=\"display:block;\">COMPARE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">3\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u30fb\u6319\u52d5\u3092\u5b8c\u5168\u6bd4\u8f03<\/span>\n  <span class=\"section-desc\">\u540c\u3058\u7d50\u679c\u3092\u5f97\u308b\u30b3\u30fc\u30c9\u3068\u3001\u6319\u52d5\u304c\u5909\u308f\u308b\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u901a\u5e38\u30b1\u30fc\u30b9\u3067\u306f\u4f3c\u305f\u3088\u3046\u306a\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u304c\u3001<strong>\u5f15\u6570\u304c\u7279\u6b8a\u306a\u5834\u5408\uff08\u8ca0\u306e\u5024\u30fb\u5f15\u6570\u306e\u9806\u5e8f\u9006\u8ee2\u30fb\u7701\u7565\u7b49\uff09\u3067\u52d5\u4f5c\u304c\u7570\u306a\u308a\u307e\u3059<\/strong>\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">const str = \"Hello World\";  \/\/ length = 11\n\n\/\/ ===== \u57fa\u672c\u30b1\u30fc\u30b9\uff08\u307b\u307c\u540c\u3058\u7d50\u679c\uff09=====\nstr.substring(0, 5)   \/\/ \"Hello\"\nstr.slice(0, 5)        \/\/ \"Hello\"\nstr.substr(0, 5)       \/\/ \"Hello\"\uff08\u975e\u63a8\u5968\uff09\n\n\/\/ ===== \u7b2c2\u5f15\u6570\u7701\u7565\uff08\u672b\u5c3e\u307e\u3067\uff09=====\nstr.substring(6)       \/\/ \"World\"\nstr.slice(6)           \/\/ \"World\"\nstr.substr(6)          \/\/ \"World\"\uff08\u975e\u63a8\u5968\uff09\n\n\/\/ ===== \u8ca0\u306e\u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 =====\nstr.slice(-5)          \/\/ \"World\"   \u2190 \u672b\u5c3e\u304b\u30895\u6587\u5b57\nstr.substring(-5)      \/\/ \"Hello World\" \u2190 -5\u30920\u3068\u3057\u3066\u6271\u3046\uff08\u5168\u4f53\uff09\nstr.substr(-5)         \/\/ \"World\"   \u2190 substr\u306f\u8ca0\u306estart\u5bfe\u5fdc\uff08\u975e\u63a8\u5968\uff09\n\n\/\/ ===== \u958b\u59cb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 > \u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 =====\nstr.slice(8, 3)        \/\/ \"\"        \u2190 \u7a7a\u6587\u5b57\u5217\nstr.substring(8, 3)    \/\/ \"lo Wo\"  \u2190 \u81ea\u52d5\u30b9\u30ef\u30c3\u30d7\uff08substring(3,8)\u3068\u540c\u3058\uff09\n\n\/\/ ===== \u5f15\u6570\u304cundefined =====\nstr.slice(undefined, 5)    \/\/ \"Hello\"   \u2190 undefined\u306f0\u3068\u3057\u3066\u6271\u3046\nstr.substring(undefined, 5)\/\/ \"Hello\"   \u2190 undefined\u306f0\u3068\u3057\u3066\u6271\u3046\n\n\/\/ ===== \u6587\u5b57\u5217\u9577\u3092\u8d85\u3048\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 =====\nstr.slice(0, 100)      \/\/ \"Hello World\"  \u2190 \u672b\u5c3e\u307e\u3067\uff08\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\uff09\nstr.substring(0, 100)  \/\/ \"Hello World\"  \u2190 \u672b\u5c3e\u307e\u3067\uff08\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\uff09\nstr.substr(0, 100)     \/\/ \"Hello World\"  \u2190 \u672b\u5c3e\u307e\u3067\uff08\u975e\u63a8\u5968\uff09<\/pre>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30b1\u30fc\u30b9<\/th><th>substring()<\/th><th>slice()<\/th><th>substr()<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>str.xxx(0, 5)<\/td><td>\"Hello\"<\/td><td>\"Hello\"<\/td><td>\"Hello\"\uff08\u6587\u5b57\u65705\uff09<\/td><\/tr>\n<tr><td>str.xxx(-5)<\/td><td>\"Hello World\"\uff08-5\u21920\u6271\u3044\uff09<\/td><td>\"World\"\uff08\u672b\u5c3e5\u6587\u5b57\uff09<\/td><td>\"World\"\uff08\u672b\u5c3e5\u6587\u5b57\uff09<\/td><\/tr>\n<tr><td>str.xxx(8, 3)<\/td><td>\"lo Wo\"\uff08\u81ea\u52d5\u30b9\u30ef\u30c3\u30d7\uff09<\/td><td>\"\"\uff08\u7a7a\u6587\u5b57\uff09<\/td><td>\"lo Wo\"\uff08\u6587\u5b57\u6570-5\u21920\uff09<\/td><\/tr>\n<tr><td>str.xxx(3)<\/td><td>\"lo World\"<\/td><td>\"lo World\"<\/td><td>\"lo World\"<\/td><\/tr>\n<tr><td>\u4eca\u5f8c\u306e\u4f7f\u7528<\/td><td>\u25ce \u63a8\u5968<\/td><td>\u25ce \u63a8\u5968<\/td><td>\u00d7 \u975e\u63a8\u5968\uff08deprecated\uff09<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u3053\u306e\u6bd4\u8f03\u8868\u3067\u6700\u3082\u91cd\u8981\u306a\u306e\u306f\u300c\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u306e\u884c\u3067\u3059\u3002slice(-5)\u306f\"World\"\u3001substring(-5)\u306f\"Hello World\"\uff08\u5168\u4f53\uff09\u3068\u7d50\u679c\u304c\u5168\u304f\u9055\u3044\u307e\u3059\u3002\u3053\u308c\u3092\u77e5\u3089\u305a\u306bslice\u3068substring\u3092\u6df7\u5728\u3055\u305b\u308b\u3068\u3001-5\u3092\u6e21\u3057\u305f\u77ac\u9593\u306b\u5168\u304f\u9055\u3046\u7d50\u679c\u306b\u306a\u3063\u3066\u6df7\u4e71\u3057\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-06\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">06<\/span>\n  <span class=\"section-label\" style=\"display:block;\">UNICODE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u65e5\u672c\u8a9e\u30fbUnicode\u30fb\u7d75\u6587\u5b57\u3092\u6b63\u3057\u304f\u6271\u3046\u65b9\u6cd5<\/span>\n  <span class=\"section-desc\">\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306e\u554f\u984c\u3068at()\u30fb\u30b9\u30d7\u30ec\u30c3\u30c9\u6f14\u7b97\u5b50\u3067\u306e\u5bfe\u51e6<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">substring()\u30fbslice()\u30fbsubstr()\u306f\u3059\u3079\u3066JavaScript\u5185\u90e8\u306eUTF-16\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002\u65e5\u672c\u8a9e\u306e\u3072\u3089\u304c\u306a\u30fb\u6f22\u5b57\u306fUTF-16\u30671\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\uff081\u6587\u5b57\uff1d1\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3067\u3059\u304c\u3001<strong>\u7d75\u6587\u5b57\uff08emoji\uff09\u3084\u4e00\u90e8\u306e\u6f22\u5b57\uff08\ud842\udfb7\u306a\u3069\uff09\u306fUTF-16\u30672\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\uff08\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\uff09<\/strong>\u3092\u4f7f\u3046\u305f\u3081\u3001slice\u3067\u5207\u308a\u51fa\u3059\u3068\u6587\u5b57\u304c\u58ca\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\uff08Surrogate Pair\uff09<\/strong>\uff1aUnicode\u6587\u5b57\u306e\u3046\u3061\u3001U+10000\u4ee5\u4e0a\u306e\u6587\u5b57\uff08\u7d75\u6587\u5b57\u30fb\u7279\u6b8a\u8a18\u53f7\u30fb\u4e00\u90e8\u6f22\u5b57\uff09\u3092JavaScript\u306e\u5185\u90e8\u8868\u73feUTF-16\u3067\u683c\u7d0d\u3059\u308b\u969b\u306b2\u3064\u306e\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u3092\u7d44\u307f\u5408\u308f\u305b\u30661\u6587\u5b57\u3092\u8868\u3059\u65b9\u5f0f\u3002javascript\u306e.length\u3084\u901a\u5e38\u306eslice\/substring\/substr\u306f\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u3067\u6570\u3048\u308b\u305f\u3081\u3001\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u6587\u5b57\u306f\u300c1\u6587\u5b57\u300d\u3067\u306f\u306a\u304f\u300c2\u300d\u3068\u6570\u3048\u3089\u308c\u3066\u3057\u307e\u3046\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ \u901a\u5e38\u306e\u65e5\u672c\u8a9e\u306f\u554f\u984c\u306a\u3057\uff08\u3072\u3089\u304c\u306a\u30fb\u6f22\u5b57\u306fBMP\u5185\uff09\nconst jp = \"\u3053\u3093\u306b\u3061\u306f\";\njp.length          \/\/ 5\uff08\u6b63\u3057\u3044\uff09\njp.slice(0, 3)     \/\/ \"\u3053\u3093\u306b\"\uff08\u6b63\u3057\u3044\uff09\n\n\/\/ \u7d75\u6587\u5b57\u306f\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\uff082\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8 = \u9577\u30552\u3068\u3057\u3066\u6271\u308f\u308c\u308b\uff09\nconst emoji = \"Hello\ud83d\ude00World\";\nemoji.length       \/\/ 13\uff08\"\ud83d\ude00\"\u304c2\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u308b\u305f\u308112\u3067\u306f\u306a\u304f13\uff09\nemoji.slice(5, 6)  \/\/ \"\"\uff08\u58ca\u308c\u305f\u6587\u5b57\uff01\u7d75\u6587\u5b57\u306e\u524d\u534a\u3060\u3051\uff09\nemoji.slice(5, 7)  \/\/ \"\ud83d\ude00\"\uff082\u3064\u53d6\u308c\u3070\u6b63\u3057\u304f\u53d6\u5f97\u3067\u304d\u308b\uff09\n\n\/\/ \ud842\udfb7\uff08U+20BB7 \/ \u5409\u306e\u65e7\u5b57\uff09\u3082\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\nconst special = \"\ud842\udfb7\u91ce\u5bb6\";\nspecial.length     \/\/ 4\uff08\"\ud842\udfb7\"\u304c2\u6587\u5b57\u5206\u306b\u30ab\u30a6\u30f3\u30c8\uff09\nspecial.slice(0, 2) \/\/ \"\ud842\udfb7\"\uff082\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u53d6\u308b\u3068\u6b63\u3057\u3044\uff09\nspecial.slice(0, 1) \/\/ \"\"\uff08\u58ca\u308c\u308b\uff09\n\n\/\/ \u6b63\u3057\u304f1\u6587\u5b57\u305a\u3064\u6271\u3046\u65b9\u6cd5\n\/\/ \u2460 \u30b9\u30d7\u30ec\u30c3\u30c9\u6f14\u7b97\u5b50\u3067\u914d\u5217\u5316\uff08\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u3092\u6b63\u3057\u304f1\u6587\u5b57\u3068\u3057\u3066\u6271\u3046\uff09\n[...emoji].length  \/\/ 12\uff08\u7d75\u6587\u5b57\u30921\u6587\u5b57\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\uff09\n[...emoji].slice(5, 6).join('')  \/\/ \"\ud83d\ude00\"\uff08\u6b63\u3057\u304f\u53d6\u5f97\uff09\n\n\/\/ \u2461 Array.from()\u3082\u540c\u3058\nArray.from(emoji).length  \/\/ 12\nArray.from(emoji).slice(5, 6).join('')  \/\/ \"\ud83d\ude00\"\n\n\/\/ \u2462 String.prototype.at()\u306f\u6b63\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u307f\uff08\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306f\u975e\u5bfe\u5fdc\uff09\nemoji.at(5)   \/\/ \"\"\uff08at()\u3082\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u306a\u306e\u3067\u58ca\u308c\u308b\uff09\n\n\/\/ \u2463 Intl.Segmenter\uff08\u6700\u65b0\u306eAPI\u3067\u66f8\u8a18\u7d20\u30af\u30e9\u30b9\u30bf\u5358\u4f4d\u306b\u5206\u5272\uff09\nconst segmenter = new Intl.Segmenter('ja', { granularity: 'grapheme' });\nconst segments = [...segmenter.segment(emoji)].map(s => s.segment);\nsegments.length       \/\/ 12\nsegments.slice(5, 6)  \/\/ [\"\ud83d\ude00\"]<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">\u65e5\u672c\u8a9e\u3072\u3089\u304c\u306a\u30fb\u6f22\u5b57\u306f\u901a\u5e38\u306eslice\u3067\u554f\u984c\u306a\u3057<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u65e5\u5e38\u7684\u306b\u3088\u304f\u4f7f\u3046\u65e5\u672c\u8a9e\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u4e00\u822c\u7684\u306a\u6f22\u5b57\uff09\u306f Unicode BMP\uff08U+0000\u301cU+FFFF\uff09\u5185\u306b\u53ce\u307e\u308b\u305f\u3081\u30011\u6587\u5b57 = 1\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u3067\u3059\u3002\u901a\u5e38\u306eslice()\u30fbsubstring()\u3067\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u307e\u3059\u3002\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306e\u554f\u984c\u304c\u8d77\u304d\u308b\u306e\u306f\u3001\u4e3b\u306b\u7d75\u6587\u5b57\u30fb\u7279\u6b8a\u8a18\u53f7\u30fb\u4e00\u90e8\u306e\u7a00\u306a\u6f22\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u51e6\u7406\u3059\u308b\u3068\u304d\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-07\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">07<\/span>\n  <span class=\"section-label\" style=\"display:block;\">USE CASES<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u5225\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30b3\u30fc\u30c9\u96c6<\/span>\n  <span class=\"section-desc\">URL\u89e3\u6790\u30fb\u30d5\u30a1\u30a4\u30eb\u62e1\u5f35\u5b50\u30fb\u30c6\u30ad\u30b9\u30c8\u5207\u308a\u6368\u3066\u306a\u3069<\/span>\n<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">7-1. \u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089\u62e1\u5f35\u5b50\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089\u62e1\u5f35\u5b50\u3092\u53d6\u5f97\uff08\u4f8b: \"photo.jpg\" \u2192 \".jpg\"\uff09\nfunction getExtension(filename) {\n    const dotIndex = filename.lastIndexOf('.');\n    if (dotIndex === -1) return '';  \/\/ \u30c9\u30c3\u30c8\u304c\u306a\u3051\u308c\u3070\u62e1\u5f35\u5b50\u306a\u3057\n    return filename.slice(dotIndex);  \/\/ \u30c9\u30c3\u30c8\u542b\u3080\u62e1\u5f35\u5b50\n}\n\ngetExtension('photo.jpg')       \/\/ \u2192 \".jpg\"\ngetExtension('archive.tar.gz')  \/\/ \u2192 \".gz\"\uff08\u6700\u5f8c\u306e\u30c9\u30c3\u30c8\u4ee5\u964d\uff09\ngetExtension('README')          \/\/ \u2192 \"\"\uff08\u62e1\u5f35\u5b50\u306a\u3057\uff09\n\n\/\/ \u62e1\u5f35\u5b50\u306a\u3057\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u90e8\u5206\u3060\u3051\u53d6\u5f97\nfunction getBaseName(filename) {\n    const dotIndex = filename.lastIndexOf('.');\n    if (dotIndex === -1) return filename;\n    return filename.slice(0, dotIndex);\n}\n\ngetBaseName('photo.jpg')  \/\/ \u2192 \"photo\"\ngetBaseName('archive.tar.gz')  \/\/ \u2192 \"archive.tar\"\n<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-2. URL\u304b\u3089\u30d1\u30b9\u30fb\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3059<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ URL\u304b\u3089\u30db\u30b9\u30c8\u540d\u4ee5\u964d\u306e\u30d1\u30b9\u3092\u53d6\u308a\u51fa\u3059\nfunction getPathFromUrl(url) {\n    \/\/ \"https:\/\/example.com\/path\/to\/page?q=test\" \u2192 \"\/path\/to\/page?q=test\"\n    const protocolEnd = url.indexOf(':\/\/');\n    if (protocolEnd === -1) return url;\n\n    const hostStart = protocolEnd + 3;\n    const pathStart = url.indexOf('\/', hostStart);\n    if (pathStart === -1) return '\/';\n\n    return url.slice(pathStart);\n}\n\ngetPathFromUrl('https:\/\/example.com\/blog\/article-1')\n\/\/ \u2192 \"\/blog\/article-1\"\n\n\/\/ \u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u524d\u306e\u30d1\u30b9\u3060\u3051\u53d6\u308a\u51fa\u3059\nfunction getCleanPath(url) {\n    const path = getPathFromUrl(url);\n    const qIndex = path.indexOf('?');\n    return qIndex === -1 ? path : path.slice(0, qIndex);\n}\n\ngetCleanPath('https:\/\/example.com\/blog\/article-1?utm_source=google')\n\/\/ \u2192 \"\/blog\/article-1\"\n<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-3. \u30c6\u30ad\u30b9\u30c8\u3092\u6307\u5b9a\u6587\u5b57\u6570\u3067\u5207\u308a\u6368\u3066\u3066\u300c...\u300d\u3092\u4ed8\u3051\u308b<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ \u30c6\u30ad\u30b9\u30c8\u3092maxLen\u6587\u5b57\u3067\u5207\u308a\u6368\u3066\u3066\u672b\u5c3e\u306b\"...\"\u3092\u4ed8\u3051\u308b\nfunction truncate(text, maxLen, suffix = '...') {\n    if (text.length <= maxLen) return text;\n    return text.slice(0, maxLen - suffix.length) + suffix;\n}\n\ntruncate('JavaScript\u3067\u6587\u5b57\u5217\u3092\u5207\u308a\u51fa\u3059\u5b8c\u5168\u30ac\u30a4\u30c9', 15)\n\/\/ \u2192 \"JavaScript\u3067\u6587\u5b57\u5217...\"\uff0815\u6587\u5b57\u4ee5\u5185\u306b\u53ce\u3081\u308b\uff09\n\ntruncate('\u77ed\u3044\u30c6\u30ad\u30b9\u30c8', 20)\n\/\/ \u2192 \"\u77ed\u3044\u30c6\u30ad\u30b9\u30c8\"\uff08maxLen\u4ee5\u4e0b\u306a\u3089\u305d\u306e\u307e\u307e\uff09\n\n\/\/ \u5358\u8a9e\u306e\u9014\u4e2d\u3067\u5207\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u7248\uff08\u82f1\u8a9e\u30c6\u30ad\u30b9\u30c8\u5411\u3051\uff09\nfunction truncateAtWord(text, maxLen) {\n    if (text.length <= maxLen) return text;\n    const truncated = text.slice(0, maxLen);\n    const lastSpace = truncated.lastIndexOf(' ');\n    return (lastSpace > 0 ? truncated.slice(0, lastSpace) : truncated) + '...';\n}\n<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-4. \u96fb\u8a71\u756a\u53f7\u30fb\u90f5\u4fbf\u756a\u53f7\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u63db<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ \"0312345678\"\uff0810\u6841\uff09\u2192 \"03-1234-5678\" \u306b\u5909\u63db\nfunction formatPhoneNumber(phone) {\n    const digits = phone.replace(\/\\D\/g, '');  \/\/ \u6570\u5b57\u306e\u307f\u62bd\u51fa\n\n    if (digits.length === 10) {\n        \/\/ \u5e02\u5916\u5c40\u756a2\u6841 + 4\u6841 + 4\u6841\n        return digits.slice(0, 2) + '-' + digits.slice(2, 6) + '-' + digits.slice(6);\n    }\n    if (digits.length === 11) {\n        \/\/ \u643a\u5e2f: 090\/080\/070 3\u6841 + 4\u6841 + 4\u6841\n        return digits.slice(0, 3) + '-' + digits.slice(3, 7) + '-' + digits.slice(7);\n    }\n    return phone;  \/\/ \u4e0d\u660e\u306a\u5f62\u5f0f\u306f\u305d\u306e\u307e\u307e\n}\n\nformatPhoneNumber('0312345678')    \/\/ \u2192 \"03-1234-5678\"\nformatPhoneNumber('09012345678')   \/\/ \u2192 \"090-1234-5678\"\n\n\/\/ \"1234567\"\uff087\u6841\uff09\u2192 \"123-4567\" \u306b\u5909\u63db\nfunction formatPostalCode(zip) {\n    const digits = zip.replace(\/\\D\/g, '');\n    if (digits.length === 7) {\n        return digits.slice(0, 3) + '-' + digits.slice(3);\n    }\n    return zip;\n}\nformatPostalCode('1234567')  \/\/ \u2192 \"123-4567\"\n<\/pre>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-08\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">08<\/span>\n  <span class=\"section-label\" style=\"display:block;\">COMBINATIONS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">at()\u30fbsplit()\u30fb\u6b63\u898f\u8868\u73fe\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/span>\n  <span class=\"section-desc\">\u6587\u5b57\u5217\u51e6\u7406\u3092\u3088\u308a\u5f37\u529b\u306b\u3059\u308b\u95a2\u9023\u30e1\u30bd\u30c3\u30c9\u3068\u306e\u4f7f\u3044\u5206\u3051<\/span>\n<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">8-1. at()\uff1a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30671\u6587\u5b57\u53d6\u5f97\uff08-1\u3067\u6700\u5f8c\u306e\u6587\u5b57\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>String.prototype.at()<\/code> \u306f ES2022 \u3067\u8ffd\u52a0\u3055\u308c\u305f\u6bd4\u8f03\u7684\u65b0\u3057\u3044\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<strong><code>str[-1]<\/code> \u306e\u3088\u3046\u306b\u672b\u5c3e\u304b\u30891\u6587\u5b57\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b at(-1) \u304c\u4f7f\u3048\u307e\u3059<\/strong>\uff08\u305f\u3060\u3057\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306f\u975e\u5bfe\u5fdc\uff09\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">const str = \"Hello World\";\n\n\/\/ at(): \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30671\u6587\u5b57\u53d6\u5f97\uff08\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u3048\u308b\uff09\nstr.at(0)    \/\/ \u2192 \"H\"\nstr.at(-1)   \/\/ \u2192 \"d\"\uff08\u6700\u5f8c\u306e\u6587\u5b57\uff09\nstr.at(-2)   \/\/ \u2192 \"l\"\uff08\u5f8c\u308d\u304b\u30892\u756a\u76ee\uff09\n\n\/\/ \u914d\u5217\u30a2\u30af\u30bb\u30b9\uff08\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u4f7f\u3048\u306a\u3044\uff09\nstr[0]       \/\/ \u2192 \"H\"\nstr[-1]      \/\/ \u2192 undefined\uff08JavaScript\u3067\u306fNG\uff09\n\n\/\/ at() \u3068 slice(-1) \u306e\u4f7f\u3044\u5206\u3051\nstr.at(-1)       \/\/ \u6700\u5f8c\u306e1\u6587\u5b57\u3060\u3051\u53d6\u308a\u305f\u3044\u3068\u304d \u2192 at(-1)\nstr.slice(-3)    \/\/ \u6700\u5f8c\u306eN\u6587\u5b57\u3092\u53d6\u308a\u305f\u3044\u3068\u304d \u2192 slice(-N)<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>String.prototype.at()\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1aES2022\uff08ES13\uff09\u3067\u8ffd\u52a0\u3055\u308c\u305fJavaScript\u306e\u6587\u5b57\u5217\u30e1\u30bd\u30c3\u30c9\u3002str.at(n) \u3067n\u756a\u76ee\u306e\u6587\u5b57\u3092\u8fd4\u3059\u3002\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08at(-1)\u3067\u6700\u5f8c\u306e\u6587\u5b57\uff09\u304c\u4f7f\u3048\u308b\u70b9\u304cstr[n]\u3068\u306e\u6700\u5927\u306e\u9055\u3044\u3002\u305f\u3060\u3057\u5185\u90e8\u7684\u306b\u306fUTF-16\u30b3\u30fc\u30c9\u30e6\u30cb\u30c3\u30c8\u5358\u4f4d\u306e\u305f\u3081\u3001\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\uff08\u7d75\u6587\u5b57\u7b49\uff09\u306f\u6b63\u3057\u304f\u6271\u3048\u306a\u3044\u3002\u30b7\u30f3\u30d7\u30eb\u306a1\u6587\u5b57\u53d6\u5f97\u306b\u306fat()\u3001\u8907\u6570\u6587\u5b57\u306e\u5207\u308a\u51fa\u3057\u306b\u306fslice()\u3092\u4f7f\u3046\u3002<\/p>\n<\/div>\n\n\n\n\n\n<h3 class=\"wp-block-heading\">8-2. split() \u3068\u306e\u7d44\u307f\u5408\u308f\u305b\uff1a\u7279\u5b9a\u533a\u5207\u308a\u3067\u5206\u5272\u3057\u3066\u304b\u3089\u5207\u308a\u51fa\u3059<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ CSV\u306e\u6700\u521d\u306e\u30ab\u30e9\u30e0\u3060\u3051\u53d6\u5f97\nconst csv = \"\u7530\u4e2d,28,\u6771\u4eac,\u30a8\u30f3\u30b8\u30cb\u30a2\";\nconst fields = csv.split(',');\nfields[0]   \/\/ \u2192 \"\u7530\u4e2d\"\n\n\/\/ URL\u306e\u30d1\u30b9\u90e8\u5206\u3092\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u5206\u5272\u3057\u3066\u6700\u5f8c\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u3092\u53d6\u5f97\nconst url = \"https:\/\/example.com\/blog\/2026\/article-title\";\nconst path = url.slice(url.indexOf('\/', 8));  \/\/ \"\/blog\/2026\/article-title\"\nconst segments = path.split('\/').filter(s => s !== '');  \/\/ [\"blog\",\"2026\",\"article-title\"]\nsegments[segments.length - 1]  \/\/ \u2192 \"article-title\"\uff08\u6700\u5f8c\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\uff09\n\n\/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u30c9\u30e1\u30a4\u30f3\u90e8\u5206\u3092\u53d6\u5f97\nconst email = \"user@example.com\";\nconst atIndex = email.indexOf('@');\nconst domain = email.slice(atIndex + 1);  \/\/ \u2192 \"example.com\"\nconst localPart = email.slice(0, atIndex); \/\/ \u2192 \"user\"\n<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8-3. \u6b63\u898f\u8868\u73fe\u306ematch()\u3068\u7d44\u307f\u5408\u308f\u305b\u308b<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;color:#d4d4d4;font-size:13px;line-height:1.8;font-family:'Consolas','Courier New',monospace;white-space:pre;\">\/\/ HTML\u30bf\u30b0\u3092\u542b\u3080\u6587\u5b57\u5217\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3060\u3051\u62bd\u51fa\uff08\u6b63\u898f\u8868\u73fe + replace\uff09\nconst html = \"<p>Hello <strong>World<\/strong><\/p>\";\nconst textOnly = html.replace(\/<[^>]+>\/g, '');  \/\/ \u2192 \"Hello World\"\n\n\/\/ \u6587\u5b57\u5217\u304b\u3089\u6570\u5b57\u90e8\u5206\u3060\u3051\u62bd\u51fa\u3057\u3066slice\nconst mixed = \"\u5b9a\u4fa112,800\u5186\uff08\u7a0e\u8fbc\uff09\";\nconst numStr = mixed.match(\/[\\d,]+\/)?.[0] || '';  \/\/ \u2192 \"12,800\"\nconst numOnly = numStr.replace(',', '');           \/\/ \u2192 \"12800\"\n\n\/\/ \u65e5\u4ed8\u6587\u5b57\u5217\u304b\u3089\u5e74\u30fb\u6708\u30fb\u65e5\u3092\u53d6\u308a\u51fa\u3059\uff08slice vs \u6b63\u898f\u8868\u73fe\uff09\nconst dateStr = \"2026-07-19\";\n\/\/ slice \u3067\u306e\u5206\u5272\nconst year  = dateStr.slice(0, 4);   \/\/ \"2026\"\nconst month = dateStr.slice(5, 7);   \/\/ \"07\"\nconst day   = dateStr.slice(8, 10);  \/\/ \"19\"\n\n\/\/ \u6b63\u898f\u8868\u73fe\u3067\u306e\u5206\u5272\uff08\u53ef\u8aad\u6027\u91cd\u8996\uff09\nconst [, y, m, d] = dateStr.match(\/(\\d{4})-(\\d{2})-(\\d{2})\/) || [];\n<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>match()\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1a\u6587\u5b57\u5217\u304c\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3059\u308b\u304b\u3092\u8abf\u3079\u3001\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u914d\u5217\u3067\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3002\u30b0\u30eb\u30fc\u30d7\u30ad\u30e3\u30d7\u30c1\u30e3\uff08()\u3067\u56f2\u3093\u3060\u90e8\u5206\uff09\u3082\u5225\u3005\u306e\u8981\u7d20\u3068\u3057\u3066\u8fd4\u3059\u3002\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306fnull\u3092\u8fd4\u3059\u305f\u3081\u3001?.[0]\u306e\u3088\u3046\u306anull\u5b89\u5168\u30a2\u30af\u30bb\u30b9\u304c\u5fc5\u8981\u3002slice\/substring\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u52d5\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u5f8c\u306e\u5207\u308a\u51fa\u3057\u304c\u53ef\u80fd\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-09\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">09<\/span>\n  <span class=\"section-label\" style=\"display:block;\">AI ASSIST<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Claude Code\u3067\u6587\u5b57\u5217\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b<\/span>\n  <span class=\"section-desc\">\u8981\u4ef6\u3092\u81ea\u7136\u8a00\u8a9e\u3067\u8aac\u660e\u3059\u308b\u3060\u3051\u3067\u6700\u9069\u306a\u5207\u308a\u51fa\u3057\u30b3\u30fc\u30c9\u304c\u5f97\u3089\u308c\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067substr\u30fbsubstring\u30fbslice\u306e\u9055\u3044\u30fbUnicode\u5bfe\u5fdc\u30fb\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u307e\u3067\u7db2\u7f85\u3057\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5834\u9762\u3067\u306f\u300c\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u3001\u5f15\u6570\u3092\u3069\u3046\u66f8\u3051\u3070\u3044\u3044\u304b\u300d\u3092\u6bce\u56de\u8003\u3048\u308b\u306e\u306f\u6642\u9593\u306e\u30e0\u30c0\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Claude Code<\/strong>\u306b\u300c\u3053\u3046\u3044\u3046\u6587\u5b57\u5217\u51e6\u7406\u3092\u66f8\u304d\u305f\u3044\u300d\u3068\u65e5\u672c\u8a9e\u3067\u6307\u793a\u3059\u308b\u3060\u3051\u3067\u3001slice\u30fbsubstring\u30fbsplit\u30fb\u6b63\u898f\u8868\u73fe\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u305f\u5b9f\u7528\u7684\u306a\u30b3\u30fc\u30c9\u304c\u3059\u3050\u306b\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002\u975e\u63a8\u5968\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u308f\u306a\u3044\u3001Unicode\u5bfe\u5fdc\u3082\u8003\u616e\u3057\u305f\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3082\u3089\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<table>\n<thead><tr><th>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/th><th>Claude Code\u3078\u306e\u6307\u793a\u4f8b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>URL\u304b\u3089\u30c9\u30e1\u30a4\u30f3\u62bd\u51fa<\/td><td>\u300cJavaScript\u3067URL\u306e\u6587\u5b57\u5217\u304b\u3089\u30db\u30b9\u30c8\u540d\uff08\u30c9\u30e1\u30a4\u30f3\u90e8\u5206\uff09\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b\u95a2\u6570\u3092\u66f8\u3044\u3066\u3002\u30d7\u30ed\u30c8\u30b3\u30eb\uff08https:\/\/\u7b49\uff09\u3082\u30d1\u30b9\u3082\u9664\u3044\u305f\u3082\u306e\u3002edge case\u3068\u3057\u3066http:\/\/\u3082https:\/\/\u3082\u5bfe\u5fdc\u3057\u3066\u300d<\/td><\/tr>\n<tr><td>\u30c6\u30ad\u30b9\u30c8\u5207\u308a\u6368\u3066<\/td><td>\u300cJavaScript\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u6700\u5927N\u6587\u5b57\u306b\u5207\u308a\u8a70\u3081\u3066\u672b\u5c3e\u306b\u300c\u2026\u300d\u3092\u3064\u3051\u308b\u95a2\u6570\u3002\u65e5\u672c\u8a9e\u3082\u6b63\u3057\u304f\u6271\u3046\u3053\u3068\u3002N\u306b\u306f\u300c\u2026\u300d\u306e3\u6587\u5b57\u3082\u542b\u3081\u308b\u300d<\/td><\/tr>\n<tr><td>\u975e\u63a8\u5968\u30b3\u30fc\u30c9\u306e\u4fee\u6b63<\/td><td>\u300c\u4ee5\u4e0b\u306eJavaScript\u30b3\u30fc\u30c9\u306esubstr()\u3092\u3059\u3079\u3066slice()\u307e\u305f\u306fsubstring()\u306b\u66f8\u304d\u63db\u3048\u3066\u3002\u52d5\u4f5c\u306f\u5909\u3048\u306a\u3044\u3067\u3002[\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051]\u300d<\/td><\/tr>\n<tr><td>\u7d75\u6587\u5b57\u5bfe\u5fdc<\/td><td>\u300c\u7d75\u6587\u5b57\u30fb\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u3092\u542b\u3080\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u3092\u6b63\u3057\u304f\u6307\u5b9a\u6587\u5b57\u6570\u3067\u5207\u308a\u51fa\u3059JavaScript\u95a2\u6570\u3092\u66f8\u3044\u3066\u3002Intl.Segmenter\u3092\u4f7f\u3063\u305f\u7248\u3068\u30b9\u30d7\u30ec\u30c3\u30c9\u6f14\u7b97\u5b50\u7248\u306e\u4e21\u65b9\u300d<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u8981\u4ef6\u3092\u65e5\u672c\u8a9e\u3067\u6307\u793a<\/strong><br><span style=\"font-size:12px;\">\u300cURL\u304b\u3089\u62e1\u5f35\u5b50\u3092<br>\u629c\u304d\u51fa\u3059\u95a2\u6570\u300d<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Claude Code\u304c\u751f\u6210<\/strong><br><span style=\"font-size:12px;\">slice\/substring\/split<br>\u3092\u9069\u5207\u306b\u4f7f\u3063\u305f<br>\u30b3\u30fc\u30c9\u304c\u8fd4\u308b<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30d6\u30e9\u30a6\u30b6\u30fbNode.js\u3067\u78ba\u8a8d<\/strong><br><span style=\"font-size:12px;\">\u30b3\u30f3\u30bd\u30fc\u30eb\u3067<br>\u52d5\u4f5c\u78ba\u8a8d<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u5fc5\u8981\u306a\u3089\u6539\u5584\u6307\u793a<\/strong><br><span style=\"font-size:12px;\">\u300cedge case\u3092<br>\u8ffd\u52a0\u3057\u3066\u300d\u7b49\u3092<br>\u8ffd\u52a0\u6307\u793a<\/span><\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Claude Code\u3078\u306e\u6307\u793a\u306b\u300csubstr\u306f\u4f7f\u308f\u306a\u3044\u3067\u3001slice()\u304bsubstring()\u3067\u66f8\u3044\u3066\u300d\u3068\u4e00\u8a00\u6dfb\u3048\u308b\u3060\u3051\u3067\u975e\u63a8\u5968\u30e1\u30bd\u30c3\u30c9\u3092\u56de\u907f\u3057\u305f\u30b3\u30fc\u30c9\u304c\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002\u53e4\u3044\u53c2\u8003\u66f8\u3084\u8a18\u4e8b\u306e\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u66f8\u304d\u5199\u3059\u7656\u304c\u3042\u308b\u65b9\u306f\u3001Claude Code\u306b\u6e21\u3057\u3066\u6700\u65b0\u306e\u66f8\u304d\u65b9\u306b\u76f4\u3057\u3066\u3082\u3089\u3046\u3068\u52b9\u7387\u7684\u3067\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">AI\u9b3c\u7ba1\u7406\u3067\u306f\u3001\u696d\u52d9\u30b7\u30b9\u30c6\u30e0\u306e\u6587\u5b57\u5217\u51e6\u7406\u30ed\u30b8\u30c3\u30af\u3092Claude Code\u3067\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u300c\u96fb\u8a71\u756a\u53f7\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u7d71\u4e00\u300d\u300c\u4f1a\u793e\u540d\u306e\u524d\u682a\u30fb\u5f8c\u682a\u306e\u6b63\u898f\u5316\u300d\u306a\u3069\u3001\u7d30\u304b\u306a\u6587\u5b57\u5217\u51e6\u7406\u306f Claude Code \u306b\u4efb\u305b\u308b\u3053\u3068\u3067\u3001\u958b\u767a\u6642\u9593\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3057\u3066\u3044\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-js-substr-string&#038;blog_slug=cc-js-substr-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-js-substr-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-10\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">10<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CONCLUSION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u307e\u3068\u3081\uff1asubstr\u30fbsubstring\u30fbslice\u306e\u9078\u629e\u57fa\u6e96<\/span>\n  <span class=\"section-desc\">\u4eca\u5f8c\u306fslice()\u307e\u305f\u306fsubstring()\u3092\u4f7f\u3044\u3001substr\u306f\u66f8\u304b\u306a\u3044<\/span>\n<\/h2>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>substr()\u306f\u975e\u63a8\u5968\uff08deprecated\uff09<\/strong>\u3002\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u89e3\u304d\u4ee5\u5916\u3067\u306f\u4f7f\u308f\u306a\u3044<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u65b0\u898f\u30b3\u30fc\u30c9\u306f<strong>slice()\u304bsubstring()<\/strong>\u3092\u4f7f\u3046\u3002\u8ff7\u3063\u305f\u3089slice()<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>slice()\u306f<strong>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u76f4\u611f\u7684<\/strong>\uff08-1\u3067\u672b\u5c3e\u3001-3\u3067\u672b\u5c3e\u304b\u30893\u6587\u5b57\u524d\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>substring()\u306f<strong>\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30920\u6271\u3044<\/strong>\u3002\u672b\u5c3e\u304b\u3089\u306e\u76f8\u5bfe\u6307\u5b9a\u306fslice\u3092\u4f7f\u3046<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u7d75\u6587\u5b57\u30fb\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2<\/strong>\u3092\u542b\u3080\u6587\u5b57\u5217\u306f\u30b9\u30d7\u30ec\u30c3\u30c9\u6f14\u7b97\u5b50\u304b Intl.Segmenter \u3092\u4f7f\u3046<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>substr()\u3092\u4f7f\u3063\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f <code>substr(start, len)<\/code> \u2192 <code>slice(start, start+len)<\/code> \u3067\u66f8\u304d\u63db\u3048\u3089\u308c\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>Claude Code\u306b\u300csubstr\u3092\u4f7f\u308f\u305aslice()\u304bsubstring()\u3067\u66f8\u3044\u3066\u300d\u3068\u6307\u793a\u3059\u308c\u3070<strong>\u5373\u5ea7\u306b\u6700\u9069\u306a\u30b3\u30fc\u30c9\u304c\u5f97\u3089\u308c\u308b<\/strong><\/span><\/div>\n\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">JavaScript\u3092\u542b\u3080\u696d\u52d9\u30b7\u30b9\u30c6\u30e0\u306eAI\u6d3b\u7528\u30fb\u81ea\u52d5\u5316\u3092\u9032\u3081\u305f\u3044\u65b9\u3078<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6587\u5b57\u5217\u51e6\u7406\u306e\u7d30\u304b\u306a\u77e5\u8b58\u3088\u308a\u3001\u696d\u52d9\u3067JavaScript\u3092\u6d3b\u7528\u3057\u3066\u4f55\u3092\u81ea\u52d5\u5316\u3059\u308b\u304b\u306e\u65b9\u304c\u91cd\u8981\u3067\u3059\u3002<br>AI\u9b3c\u7ba1\u7406\u3067\u306f\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30fb\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3092\u554f\u308f\u305a\u696d\u52d9\u30b7\u30b9\u30c6\u30e0\u306eAI\u7d44\u307f\u8fbc\u307f\u30fb\u81ea\u52d5\u5316\u8a2d\u8a08\u3092\u652f\u63f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300cJavaScript\u306e\u30b3\u30fc\u30c9\u306fClaude Code\u304c\u66f8\u3044\u3066\u304f\u308c\u308b\u3002\u3067\u3082\u4f55\u3092\u4f5c\u308c\u3070\u3044\u3044\u304b\u304c\u5206\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u76f8\u8ac7\u3082\u6b53\u8fce\u3067\u3059\u3002\u696d\u52d9\u30d5\u30ed\u30fc\u306e\u6574\u7406\u304b\u3089\u81ea\u52d5\u5316\u306e\u8a2d\u8a08\u307e\u3067\u4e00\u7dd2\u306b\u8003\u3048\u307e\u3059\u3002\u307e\u305a\u306f\u7121\u6599\u76f8\u8ac7\u3067\u304a\u6c17\u8efd\u306b\u3069\u3046\u305e\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);border-radius:16px;padding:36px 32px;margin:48px 0 16px;color:#fff;\">\n  <p style=\"font-size:13px;font-weight:700;color:#dc2626;letter-spacing:2px;margin:0 0 12px;\">NEXT STEP<\/p>\n  <p style=\"font-size:22px;font-weight:800;line-height:1.5;margin:0 0 20px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u3092\u3001\u3042\u306a\u305f\u306e\u30d3\u30b8\u30cd\u30b9\u3067<br>\u5b9f\u8df5\u3057\u3066\u307f\u307e\u305b\u3093\u304b\uff1f<\/p>\n  <div style=\"background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);border-radius:12px;padding:24px;max-width:560px;margin:0 auto;\">\n    <p style=\"font-size:13px;color:#dc2626;font-weight:700;margin:0 0 8px;\">AI\u6d3b\u7528\u3092\u81ea\u793e\u3067\u56de\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u65b9\u3078<\/p>\n    <p style=\"font-size:20px;font-weight:800;margin:0 0 12px;\">AI\u9b3c\u7ba1\u7406<\/p>\n    <p style=\"font-size:14px;color:rgba(255,255,255,0.75);margin:0 0 20px;line-height:1.7;\">Claude Code\u30fbCowork\u5c0e\u5165\u652f\u63f4\u304b\u3089\u696d\u52d9\u8a2d\u8a08\u30fb\u793e\u5185\u6d78\u900f\u307e\u3067\u5b9f\u8df5\u30d9\u30fc\u30b9\u3067\u4f34\u8d70\u3002\u300c\u81ea\u793e\u3067\u56de\u305b\u308b\u7d44\u7e54\u300d\u309290\u65e5\u3067\u4f5c\u308b\u7d4c\u55b6\u8005\u5411\u3051\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3002<\/p>\n    <div style=\"text-align:center;\">\n      <a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&utm_medium=article&utm_campaign=cc-js-substr-string&utm_content=next-step-cta\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#dc2626;color:#fff;font-weight:700;font-size:15px;padding:14px 32px;border-radius:30px;text-decoration:none;\">AI\u9b3c\u7ba1\u7406\u3092\u8a73\u3057\u304f\u898b\u308b \u2192<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. substr\u3068substring\u306e\u5f15\u6570\u306e\u4e00\u756a\u5206\u304b\u308a\u3084\u3059\u3044\u899a\u3048\u65b9\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. substr()\u306e\u300cr\u300d\u306f\u300c\u9577\u3055\uff08range\/length\uff09\u300d\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u7b2c2\u5f15\u6570\u304c\u300c\u6587\u5b57\u6570\u300d\u3002substring()\u306e\u300cing\u300d\u306f\u300c\u301c\u304b\u3089\u301c\u307e\u3067\u300d\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u7b2c2\u5f15\u6570\u304c\u300c\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u3068\u899a\u3048\u308b\u3068\u6df7\u4e71\u304c\u6e1b\u308a\u307e\u3059\u3002\u3082\u3057\u304f\u306f\u300csubstring\/slice\u306f\u7b2c2\u5f15\u6570\u304c\u7d42\u4e86\u4f4d\u7f6e\uff08\u540c\u3058\uff09\u3001substr\u3060\u3051\u304c\u6587\u5b57\u6570\uff08\u9055\u3046\uff09\u300d\u3068substr\u3092\u4f8b\u5916\u3068\u3057\u3066\u899a\u3048\u308b\u65b9\u6cd5\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. substr()\u306f\u307e\u3060\u5168\u30d6\u30e9\u30a6\u30b6\u3067\u52d5\u304d\u307e\u3059\u304b\uff1f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. 2026\u5e747\u6708\u73fe\u5728\u3001\u4e3b\u8981\u306a\u30d6\u30e9\u30a6\u30b6\uff08Chrome\u30fbFirefox\u30fbSafari\u30fbEdge\uff09\u3068Node.js\u3067substr()\u306f\u307e\u3060\u52d5\u4f5c\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001MDN Web Docs\u306e\u300cdeprecated\u300d\u8868\u793a\u306e\u901a\u308a\u3001\u5c06\u6765\u7684\u306b\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u3001\u7a4d\u6975\u7684\u306a\u4f7f\u7528\u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u65e2\u5b58\u306e\u30b3\u30fc\u30c9\u304c\u52d5\u3044\u3066\u3044\u308b\u3046\u3061\u306b\u3001\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306fslice()\u307e\u305f\u306fsubstring()\u306b\u7d71\u4e00\u3059\u308b\u6e96\u5099\u3092\u9032\u3081\u308b\u3053\u3068\u304c\u671b\u307e\u3057\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u65e5\u672c\u8a9e\u306e\u6587\u5b57\u6570\u30ab\u30a6\u30f3\u30c8\u306blength\u3092\u4f7f\u3063\u3066\u554f\u984c\u306a\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u4e00\u822c\u7684\u306a\u65e5\u672c\u8a9e\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u3088\u304f\u4f7f\u308f\u308c\u308b\u6f22\u5b57\uff09\u306fUnicode BMP\u5185\u306b\u3042\u308b\u305f\u3081\u3001str.length\u3067\u6b63\u3057\u3044\u6587\u5b57\u6570\u304c\u8fd4\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u7d75\u6587\u5b57\uff08\ud83d\ude00\u7b49\uff09\u3084\u3054\u304f\u4e00\u90e8\u306e\u6f22\u5b57\uff08\ud842\udfb7\u306e\u65e7\u5b57\u306a\u3069\uff09\u306f\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306e\u305f\u3081\u3001length\u30672\u3064\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u3002\u7d75\u6587\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u306e\u6b63\u78ba\u306a\u6587\u5b57\u6570\u306f[...str].length\u307e\u305f\u306fArray.from(str).length\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. slice()\u3068substring()\u306e\u4f7f\u3044\u5206\u3051\u306e\u5224\u65ad\u57fa\u6e96\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u300c\u672b\u5c3e\u304b\u3089\u306e\u76f8\u5bfe\u4f4d\u7f6e\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306fslice()\u3001\u4f7f\u308f\u306a\u3044\u5834\u5408\u306fsubstring()\u3067\u3082\u3088\u3044\u300d\u3068\u3044\u3046\u306e\u304c\u57fa\u672c\u306e\u5224\u65ad\u57fa\u6e96\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001\u672b\u5c3e5\u6587\u5b57\u3092\u53d6\u308a\u305f\u3044\u306a\u3089slice(-5)\u3001\u5148\u982d3\u6587\u5b57\u3092\u9664\u3044\u305f\u6b8b\u308a\u3092\u53d6\u308a\u305f\u3044\u306a\u3089\u3069\u3061\u3089\u3067\u3082\u66f8\u3051\u307e\u3059\uff08slice(3)\u307e\u305f\u306fsubstring(3)\uff09\u3002\u5f15\u6570\u306e\u9806\u5e8f\u304c\u9006\u8ee2\u3059\u308b\u30b1\u30fc\u30b9\uff08\u4f8b: \u52d5\u7684\u306b\u8a08\u7b97\u3057\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5076\u7136start\u3088\u308a\u5c0f\u3055\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\uff09\u306fslice\u306e\u65b9\u304c\u300c\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3057\u3066\u5931\u6557\u3092\u660e\u793a\u3059\u308b\u300d\u305f\u3081\u5b89\u5168\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u304d\u63db\u3048\u308b\u306b\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. slice()\u3067\u5207\u308a\u51fa\u3057\u305f\u90e8\u5206\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u7f6e\u304d\u63db\u3048\u308b\u65b9\u6cd5\u3068\u3001replace()\u30fbreplaceAll()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u5b9a\u4f4d\u7f6e\u306e\u6587\u5b57\u3092\u7f6e\u304d\u63db\u3048\u305f\u3044\u5834\u5408: str.slice(0, i) + newChar + str.slice(i + 1)\u306e\u3088\u3046\u306bslice\u3067\u524d\u5f8c\u3092\u53d6\u308a\u51fa\u3057\u3066\u7e4b\u3052\u307e\u3059\u3002\u6587\u5b57\u5217\u3068\u3057\u3066\u51fa\u73fe\u3059\u308b\u90e8\u5206\u3092\u7f6e\u304d\u63db\u3048\u305f\u3044\u5834\u5408: str.replace(\"old\", \"new\")\u307e\u305f\u306fstr.replaceAll(\"old\", \"new\")\u304c\u7c21\u6f54\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Claude Code\u306bJavaScript\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u66f8\u3044\u3066\u3082\u3089\u3046\u3068\u304d\u3001\u3069\u3093\u306a\u6307\u793a\u304c\u52b9\u679c\u7684\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u2460\u4f55\u306e\u6587\u5b57\u5217\u304b\u3089\u4f55\u3092\u53d6\u308a\u51fa\u3057\u305f\u3044\u304b\uff08\u4f8b: \u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30c9\u30e1\u30a4\u30f3\u90e8\u5206\u3060\u3051\u300d\uff09\u3001\u2461\u5165\u529b\u4f8b\u3068\u671f\u5f85\u3059\u308b\u51fa\u529b\u4f8b\u3092\u6570\u500b\uff08\u4f8b: \u300c\"user@example.com\" \u2192 \"example.com\"\u300d\uff09\u3001\u2462edge case\uff08\u4f8b: \u300c@\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u30fb@\u304c\u306a\u3044\u5834\u5408\u306f\u3069\u3046\u3059\u308b\u300d\uff09\u3001\u2463\u4f7f\u3063\u3066\u307b\u3057\u304f\u306a\u3044\u30e1\u30bd\u30c3\u30c9\uff08\u4f8b: \u300csubstr\u306f\u4f7f\u308f\u306a\u3044\u3067\u300d\uff09\u306e4\u70b9\u3092\u30bb\u30c3\u30c8\u3067\u4f1d\u3048\u308b\u3068\u3001\u4e00\u767a\u3067\u5b9f\u7528\u7684\u306a\u30b3\u30fc\u30c9\u304c\u8fd4\u3063\u3066\u304f\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"substr\u3068substring\u306e\u5f15\u6570\u306e\u4e00\u756a\u5206\u304b\u308a\u3084\u3059\u3044\u899a\u3048\u65b9\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"substr()\u306e\u300cr\u300d\u306f\u300c\u9577\u3055\uff08range\/length\uff09\u300d\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u7b2c2\u5f15\u6570\u304c\u300c\u6587\u5b57\u6570\u300d\u3002substring()\u306e\u300cing\u300d\u306f\u300c\u301c\u304b\u3089\u301c\u307e\u3067\u300d\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u7b2c2\u5f15\u6570\u304c\u300c\u7d42\u4e86\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u3068\u899a\u3048\u308b\u3068\u6df7\u4e71\u304c\u6e1b\u308a\u307e\u3059\u3002\u3082\u3057\u304f\u306f\u300csubstring\/slice\u306f\u7b2c2\u5f15\u6570\u304c\u7d42\u4e86\u4f4d\u7f6e\uff08\u540c\u3058\uff09\u3001substr\u3060\u3051\u304c\u6587\u5b57\u6570\uff08\u9055\u3046\uff09\u300d\u3068substr\u3092\u4f8b\u5916\u3068\u3057\u3066\u899a\u3048\u308b\u65b9\u6cd5\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"substr()\u306f\u307e\u3060\u5168\u30d6\u30e9\u30a6\u30b6\u3067\u52d5\u304d\u307e\u3059\u304b\uff1f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"2026\u5e747\u6708\u73fe\u5728\u3001\u4e3b\u8981\u306a\u30d6\u30e9\u30a6\u30b6\uff08Chrome\u30fbFirefox\u30fbSafari\u30fbEdge\uff09\u3068Node.js\u3067substr()\u306f\u307e\u3060\u52d5\u4f5c\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001MDN Web Docs\u306e\u300cdeprecated\u300d\u8868\u793a\u306e\u901a\u308a\u3001\u5c06\u6765\u7684\u306b\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u3001\u7a4d\u6975\u7684\u306a\u4f7f\u7528\u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u65e2\u5b58\u306e\u30b3\u30fc\u30c9\u304c\u52d5\u3044\u3066\u3044\u308b\u3046\u3061\u306b\u3001\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306fslice()\u307e\u305f\u306fsubstring()\u306b\u7d71\u4e00\u3059\u308b\u6e96\u5099\u3092\u9032\u3081\u308b\u3053\u3068\u304c\u671b\u307e\u3057\u3044\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u6570\u30ab\u30a6\u30f3\u30c8\u306blength\u3092\u4f7f\u3063\u3066\u554f\u984c\u306a\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u4e00\u822c\u7684\u306a\u65e5\u672c\u8a9e\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u3088\u304f\u4f7f\u308f\u308c\u308b\u6f22\u5b57\uff09\u306fUnicode BMP\u5185\u306b\u3042\u308b\u305f\u3081\u3001str.length\u3067\u6b63\u3057\u3044\u6587\u5b57\u6570\u304c\u8fd4\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u7d75\u6587\u5b57\uff08\ud83d\ude00\u7b49\uff09\u3084\u3054\u304f\u4e00\u90e8\u306e\u6f22\u5b57\uff08\ud842\udfb7\u306e\u65e7\u5b57\u306a\u3069\uff09\u306f\u30b5\u30ed\u30b2\u30fc\u30c8\u30da\u30a2\u306e\u305f\u3081\u3001length\u30672\u3064\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u3002\u7d75\u6587\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u306e\u6b63\u78ba\u306a\u6587\u5b57\u6570\u306f[...str].length\u307e\u305f\u306fArray.from(str).length\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"slice()\u3068substring()\u306e\u4f7f\u3044\u5206\u3051\u306e\u5224\u65ad\u57fa\u6e96\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u300c\u672b\u5c3e\u304b\u3089\u306e\u76f8\u5bfe\u4f4d\u7f6e\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306fslice()\u3001\u4f7f\u308f\u306a\u3044\u5834\u5408\u306fsubstring()\u3067\u3082\u3088\u3044\u300d\u3068\u3044\u3046\u306e\u304c\u57fa\u672c\u306e\u5224\u65ad\u57fa\u6e96\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001\u672b\u5c3e5\u6587\u5b57\u3092\u53d6\u308a\u305f\u3044\u306a\u3089slice(-5)\u3001\u5148\u982d3\u6587\u5b57\u3092\u9664\u3044\u305f\u6b8b\u308a\u3092\u53d6\u308a\u305f\u3044\u306a\u3089\u3069\u3061\u3089\u3067\u3082\u66f8\u3051\u307e\u3059\uff08slice(3)\u307e\u305f\u306fsubstring(3)\uff09\u3002\u5f15\u6570\u306e\u9806\u5e8f\u304c\u9006\u8ee2\u3059\u308b\u30b1\u30fc\u30b9\uff08\u4f8b: \u52d5\u7684\u306b\u8a08\u7b97\u3057\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5076\u7136start\u3088\u308a\u5c0f\u3055\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\uff09\u306fslice\u306e\u65b9\u304c\u300c\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3057\u3066\u5931\u6557\u3092\u660e\u793a\u3059\u308b\u300d\u305f\u3081\u5b89\u5168\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u304d\u63db\u3048\u308b\u306b\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"slice()\u3067\u5207\u308a\u51fa\u3057\u305f\u90e8\u5206\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u7f6e\u304d\u63db\u3048\u308b\u65b9\u6cd5\u3068\u3001replace()\u30fbreplaceAll()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u5b9a\u4f4d\u7f6e\u306e\u6587\u5b57\u3092\u7f6e\u304d\u63db\u3048\u305f\u3044\u5834\u5408: str.slice(0, i) + newChar + str.slice(i + 1)\u306e\u3088\u3046\u306bslice\u3067\u524d\u5f8c\u3092\u53d6\u308a\u51fa\u3057\u3066\u7e4b\u3052\u307e\u3059\u3002\u6587\u5b57\u5217\u3068\u3057\u3066\u51fa\u73fe\u3059\u308b\u90e8\u5206\u3092\u7f6e\u304d\u63db\u3048\u305f\u3044\u5834\u5408: str.replace(\\\"old\\\", \\\"new\\\")\u307e\u305f\u306fstr.replaceAll(\\\"old\\\", \\\"new\\\")\u304c\u7c21\u6f54\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Claude Code\u306bJavaScript\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u66f8\u3044\u3066\u3082\u3089\u3046\u3068\u304d\u3001\u3069\u3093\u306a\u6307\u793a\u304c\u52b9\u679c\u7684\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u2460\u4f55\u306e\u6587\u5b57\u5217\u304b\u3089\u4f55\u3092\u53d6\u308a\u51fa\u3057\u305f\u3044\u304b\uff08\u4f8b: \u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30c9\u30e1\u30a4\u30f3\u90e8\u5206\u3060\u3051\u300d\uff09\u3001\u2461\u5165\u529b\u4f8b\u3068\u671f\u5f85\u3059\u308b\u51fa\u529b\u4f8b\u3092\u6570\u500b\uff08\u4f8b: \u300c\\\"user@example.com\\\" \u2192 \\\"example.com\\\"\u300d\uff09\u3001\u2462edge case\uff08\u4f8b: \u300c@\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u30fb@\u304c\u306a\u3044\u5834\u5408\u306f\u3069\u3046\u3059\u308b\u300d\uff09\u3001\u2463\u4f7f\u3063\u3066\u307b\u3057\u304f\u306a\u3044\u30e1\u30bd\u30c3\u30c9\uff08\u4f8b: \u300csubstr\u306f\u4f7f\u308f\u306a\u3044\u3067\u300d\uff09\u306e4\u70b9\u3092\u30bb\u30c3\u30c8\u3067\u4f1d\u3048\u308b\u3068\u3001\u4e00\u767a\u3067\u5b9f\u7528\u7684\u306a\u30b3\u30fc\u30c9\u304c\u8fd4\u3063\u3066\u304f\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u306a\u308a\u307e\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"<p>JavaScript\u306esubstr\uff08\u975e\u63a8\u5968\uff09\u30fbsubstring\u30fbslice\u306e\u9055\u3044\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u5f15\u6570\u306e\u6319\u52d5\u30fb\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5dee\u30fbUnicode\/\u7d75\u6587\u5b57\u306e\u6ce8\u610f\u70b9\u30fbURL\u89e3\u6790\u30fb\u30c6\u30ad\u30b9\u30c8\u5207\u308a\u6368\u3066\u306a\u3069\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u30fbClaude Code\u6d3b\u7528\u307e\u3067\u7db2\u7f85\u3002<\/p>\n","protected":false},"author":1,"featured_media":18432,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sitemap_hide":"","_veu_custom_css":"","vkexunit_cta_each_option":"","footnotes":"","rank_math_description":"JavaScript\u306esubstr\uff08\u975e\u63a8\u5968\uff09\u30fbsubstring\u30fbslice\u306e\u9055\u3044\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u5f15\u6570\u306e\u6319\u52d5\u30fb\u8ca0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5dee\u30fbUnicode\/\u7d75\u6587\u5b57\u306e\u6ce8\u610f\u70b9\u30fbURL\u89e3\u6790\u30fb\u30c6\u30ad\u30b9\u30c8\u5207\u308a\u6368\u3066\u306a\u3069\u5b9f\u52d9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u30fbClaude Code\u6d3b\u7528\u307e\u3067\u7db2\u7f85\u3002","rank_math_focus_keyword":"JavaScript substr substring slice","rank_math_title":"\u30102026\u5e747\u6708\u6700\u65b0\u3011JavaScript substr\u30fbsubstring\u30fbslice \u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u975e\u63a8\uff5cAI\u9b3c\u7ba1\u7406","pending_rewrite_html":"","pending_rewrite_id":"","pending_rewrite_kw":"","pending_rewrite_at":"","pending_rewrite_source":"","pending_rewrite_brief":"","pending_rewrite_evidence":"","approved_rewrite_html":"","approved_rewrite_id":"","approved_rewrite_kw":"","approved_rewrite_at":"","approved_rewrite_by":"","approved_rewrite_brief":"","approved_rewrite_evidence":"","rewrite_tracker_baseline":"","rewrite_tracker_7day":"","rewrite_tracker_14day":"","rewrite_tracker_30day":"","rewrite_tracker_notified":""},"categories":[3,2],"tags":[],"class_list":["post-18433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation","category-claude-tips"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/comments?post=18433"}],"version-history":[{"count":2,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18433\/revisions"}],"predecessor-version":[{"id":18435,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18433\/revisions\/18435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/18432"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=18433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=18433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=18433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}