Intl.Segmenter についておさらい JavaScript には Intl と呼ばれる国際化 API があり、日時や数値のフォーマットを始めとする国際化に便利な機能が揃っています。Intl.Segmenter はこの Intl の一機能で、文字・単語・文章単位での文字列分割を可能にします。 文字単位での分割では複数のコードユニットやコードポイントを持った文字を考慮し、正確に見た目上の1文字(書記素)で分割できるので、絵文字を含んだ文字数のカウントなどに便利です。 const segmenter = new Intl.Segmenter("ja", { granularity: "grapheme" }); console.log("🇯🇵👨🏻💻".length); // ❌ 11 console.log([..."🇯🇵👨🏻💻"].length); // ❌
Back to BlogThursday, February 23rd 2023 Next.js 13.2Posted by Next.js 13.2 includes major improvements to the App Router (app) in preparation for stability: Built-in SEO Support: New Metadata API to set static and dynamic meta tags. Route Handlers: Custom request handlers, built on Web Request and Response. MDX for Server Components: Use React components inside Markdown, server-side only. Rust MD
Today we’re excited to announce our beta release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We’ve implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers, new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuratio
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く