<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1" -->

---
title: Split a JavaScript string into words | daily.dev
description: Learn how to split a JavaScript string into words using the Intl.Segmenter constructor.
canonical: https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Split a JavaScript string into words | daily.dev
og:description: Learn how to split a JavaScript string into words using the Intl.Segmenter constructor.
og:url: https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1
og:image: https://api.daily.dev/og/posts/6d2wdCyd1.png
og:image:alt: Split a JavaScript string into words
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Split a JavaScript string into words

**[30 seconds of code](https://daily.dev/sources/30seconds)** · 2 min read · 11 upvotes · 2 comments

## Summary

Learn how to split a JavaScript string into words using the Intl.Segmenter constructor.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.30secondsofcode.org/js/s/string-to-words>

## Community discussion

Top comments from developers on daily.dev.

**@stefan30** · 1 upvotes

> Interesting way of splitting a sentence. Must confess that I never heard of it before 😂. Thanks for sharing!

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Split a JavaScript string into words","url":"https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1"},"datePublished":"2024-01-24T18:29:49.758Z","dateModified":"2024-05-09T08:58:27.770Z","description":"Learn how to split a JavaScript string into words using the Intl.Segmenter constructor.","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d03dfe3e90ac6988794d5d086fd3933d?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d03dfe3e90ac6988794d5d086fd3933d?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"30 seconds of code","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"30 seconds of code","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89","url":"https://daily.dev/sources/30seconds"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":11},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"javascript","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"30 seconds of code","item":"https://daily.dev/sources/30seconds"},{"@type":"ListItem","position":3,"name":"Split a JavaScript string into words"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/split-a-javascript-string-into-words-6d2wdcyd1","comment":[{"@type":"Comment","text":"Interesting way of splitting a sentence. Must confess that I never heard of it before 😂. Thanks for sharing!","datePublished":"2024-01-24T20:24:13.429Z","url":"https://daily.dev/posts/6d2wdCyd1#c-75lCJEKUR","author":{"@type":"Person","name":"Stefan Secrieru","url":"https://daily.dev/stefan30","image":"https://avatars.githubusercontent.com/u/92794548?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

