---
title: "Meaning & Key Takeaway of: suppress empty strings in the output…"
description: "\"“suppress empty strings in the output array when the separator is a regular expression: var f = '|a|b|c|'.split(/\\|/); // f is ['a', 'b', 'c'] on some ..."
image: "https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png"
---

#  suppress empty strings in the output array when the…

![“suppress empty strings in the output array when the separator is a regular expression: var f = '|a|b|c|'.split(/&#92;|/); // f is &#91;'a', 'b', 'c'&#93; on some systems, and // f is &#91;'', 'a', 'b', 'c', ''&#93; on others string.substring(start, end ) The substring method is the same as the slice method except…” quote by Douglas Crockford](https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png)   [Download](https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png) [Open image](https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png)

> ““suppress empty strings in the output array when the separator is a regular expression: var f = '\|a\|b\|c\|'.split(/\\\|/); // f is \['a', 'b', 'c'\] on some systems, and // f is \['', 'a', 'b', 'c', ''\] on others string.substring(start, end ) The substring method is the same as the slice method except that it doesn’t handle the adjustment for negative parameters. There is no reason to use the substring method. Use slice instead. string.toLocaleLowerCase( ) The toLocaleLowerCase method produces a new string that is made by converting this string to lowercase using the rules for the locale. This is primarily for the benefit of Turkish because in that language 'I’ converts to 1””

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

The quote discusses best practices for string handling in programming, emphasizing consistent splitting, preferring slice over substring, and locale-aware case conversion.

**In simple terms:** Use reliable string methods and locale-aware case conversion.

Key Takeaway

Prefer slice, handle empty splits, respect locale.

Themes

programming best practices string handling

Mood

technical informative

Type

advice instructional

When to use this quote

- data parsing
- internationalization
- code portability

Key Concepts

splitting slice vs substring locale case conversion

Questions to Reflect On

- How do you ensure consistent split results?
- When should you choose slice over substring?

A Different Perspective

Neglecting locale can cause bugs in Turkish text.

★ ★ ★ ★ ★   No ratings yet

[Productivity](https://sms4smile.com/quotes/about/productivity/) [Technology](https://sms4smile.com/quotes/about/technology/)

## Related quotes

> [Performance matters because games are built on great performance, but form factor and energy efficiency matter incredibly because they want to build something that's…](https://sms4smile.com/quotes/jensen-huang/performance-matters-because-games-are-built-on-great-performance-but/)

[Jensen Huang](https://sms4smile.com/quotes/author/jensen-huang/)

> [As American productivity, once the exuberant engine of national wealth, has dipped to an embarrassingly uncompetitive low, Americans have shaken their heads: the country's…](https://sms4smile.com/quotes/lance-morrow/as-american-productivity-once-the-exuberant-engine-of-national-wealth/)

[Lance Morrow](https://sms4smile.com/quotes/author/lance-morrow/)

> [Everyday, all day I have to be productive. And when I ain't productive, I get concerned.](https://sms4smile.com/quotes/young-jeezy/everyday-all-day-i-have-to-be-productive-and-when-i-ain-t-productive/)

[Young Jeezy](https://sms4smile.com/quotes/author/young-jeezy/)

> [“You can remodel yourself to anything you want to become.”](https://sms4smile.com/quotes/sunday-adelaja/you-can-remodel-yourself-to-anything-you-want-to-become/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

> [“Don’t let procrastination hold you back. Every small decision counts toward your potential. Be wise”](https://sms4smile.com/quotes/afolayan-david-ojo/don-t-let-procrastination-hold-you-back-every-small-decision-counts/)

Afolayan David Ojo

> [he cult of productivity has its place, but worshipping at its altar daily robs us of the very capacity for joy and wonder that…](https://sms4smile.com/quotes/maria-popova/he-cult-of-productivity-has-its-place-but-worshipping-at-its-altar/)

[Maria Popova](https://sms4smile.com/quotes/author/maria-popova/)

> [To settle space, we will have to develop the ability to harvest and utilize the resources of the solar system, such as ores, ice,…](https://sms4smile.com/quotes/rick-tumlinson/to-settle-space-we-will-have-to-develop-the-ability-to-harvest-and/)

[Rick Tumlinson](https://sms4smile.com/quotes/author/rick-tumlinson/)

> [Many companies have long contended that stress in the home causes productivity loss in the market place.. and it does. But research now reveals…](https://sms4smile.com/quotes/zig-ziglar/many-companies-have-long-contended-that-stress-in-the-home-causes/)

[Zig Ziglar](https://sms4smile.com/quotes/author/zig-ziglar/)

> [Focus on being productive instead of busy.](https://sms4smile.com/quotes/tim-ferriss/focus-on-being-productive-instead-of-busy/)

[Tim Ferriss](https://sms4smile.com/quotes/author/tim-ferriss/)

> [One of my most productive days was throwing away 1,000 lines of code.](https://sms4smile.com/quotes/ken-thompson/one-of-my-most-productive-days-was-throwing-away-1-000-lines-of-code/)

[Ken Thompson](https://sms4smile.com/quotes/author/ken-thompson/)

> [Normally, it's more efficient to climb fast.](https://sms4smile.com/quotes/adam-ondra/normally-it-s-more-efficient-to-climb-fast/)

[Adam Ondra](https://sms4smile.com/quotes/author/adam-ondra/)

> [Create an environment for people to fail, to learn, and to grow. Their creativity and productivity will increase.](https://sms4smile.com/quotes/anonymous/create-an-environment-for-people-to-fail-to-learn-and-to-grow-their/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [“The power of imagination is strongest in the place of solitude.”](https://sms4smile.com/quotes/sunday-adelaja/the-power-of-imagination-is-strongest-in-the-place-of-solitude/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

> [Everybody is different. Some writers can write reams of great books and then J. D. Salinger wrote just a few. Beethoven wrote nine symphonies.…](https://sms4smile.com/quotes/billy-joel/everybody-is-different-some-writers-can-write-reams-of-great-books/)

[Billy Joel](https://sms4smile.com/quotes/author/billy-joel/)

> [“To reproduce your life is to convert it into tangible products for the benefit of humanity. To reproduce your life is to impact the…](https://sms4smile.com/quotes/sunday-adelaja/to-reproduce-your-life-is-to-convert-it-into-tangible-products-for/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

## More by Douglas Crockford

> [Progress comes from finding better ways to do things. Don't be afraid of innovation. Don't be afraid of ideas that are not your own.](https://sms4smile.com/quotes/douglas-crockford/progress-comes-from-finding-better-ways-to-do-things-don-t-be-afraid/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [“If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.”](https://sms4smile.com/quotes/douglas-crockford/if-you-want-to-learn-more-about-the-bad-parts-and-how-to-use-them/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [JavaScript is the only language that I'm aware of that people feel they don't need to learn before they start using it.](https://sms4smile.com/quotes/douglas-crockford/javascript-is-the-only-language-that-i-m-aware-of-that-people-feel/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Most programming languages contain good parts and bad parts. I discovered that I could be better programmer by using only the good parts and…](https://sms4smile.com/quotes/douglas-crockford/most-programming-languages-contain-good-parts-and-bad-parts-i/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [People who use Class will never understand all the crap they are doing.](https://sms4smile.com/quotes/douglas-crockford/people-who-use-class-will-never-understand-all-the-crap-they-are-doing/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [“Few classical programmers found prototypal inheritance to be acceptable, and classically inspired syntax obscures the language’s true prototypal nature. It is the worst of…](https://sms4smile.com/quotes/douglas-crockford/few-classical-programmers-found-prototypal-inheritance-to-be/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Computer programs are the most complex things that humans make.](https://sms4smile.com/quotes/douglas-crockford/computer-programs-are-the-most-complex-things-that-humans-make/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [The good thing about reinventing the wheel is that you can get a round one.](https://sms4smile.com/quotes/douglas-crockford/the-good-thing-about-reinventing-the-wheel-is-that-you-can-get-a/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Good architecture is necessary to give programs enough structure to be able to grow large without collapsing into a puddle of confusion.](https://sms4smile.com/quotes/douglas-crockford/good-architecture-is-necessary-to-give-programs-enough-structure-to/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [“undefined and NaN are not constants. They are global variables, and you can change their values. That should not be possible, and yet it…](https://sms4smile.com/quotes/douglas-crockford/undefined-and-nan-are-not-constants-they-are-global-variables-and-you/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Programmers are as emotional and irrational as normal people](https://sms4smile.com/quotes/douglas-crockford/programmers-are-as-emotional-and-irrational-as-normal-people/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Generally, the craft of programming is the factoring of a set of requirements into a a set of functions and data structures.](https://sms4smile.com/quotes/douglas-crockford/generally-the-craft-of-programming-is-the-factoring-of-a-set-of/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [I have been writing JavaScript for 8 years now, and I have never once found need to use an uber function. The super idea…](https://sms4smile.com/quotes/douglas-crockford/i-have-been-writing-javascript-for-8-years-now-and-i-have-never-once/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [Things don't change because people change their minds. They change because they retire or die.](https://sms4smile.com/quotes/douglas-crockford/things-don-t-change-because-people-change-their-minds-they-change/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

> [It turns out that strong typing does not eliminate the need for careful testing. And I have found in my work that the sorts…](https://sms4smile.com/quotes/douglas-crockford/it-turns-out-that-strong-typing-does-not-eliminate-the-need-for/)

[Douglas Crockford](https://sms4smile.com/quotes/author/douglas-crockford/)

[Explore all 33 Douglas Crockford quotes ](https://sms4smile.com/quotes/author/douglas-crockford/)

## More Productivity quotes

> [Performance matters because games are built on great performance, but form factor and energy efficiency matter incredibly because they want to build something that's…](https://sms4smile.com/quotes/jensen-huang/performance-matters-because-games-are-built-on-great-performance-but/)

[Jensen Huang](https://sms4smile.com/quotes/author/jensen-huang/)

> [Everybody is different. Some writers can write reams of great books and then J. D. Salinger wrote just a few. Beethoven wrote nine symphonies.…](https://sms4smile.com/quotes/billy-joel/everybody-is-different-some-writers-can-write-reams-of-great-books/)

[Billy Joel](https://sms4smile.com/quotes/author/billy-joel/)

> [“The power of imagination is strongest in the place of solitude.”](https://sms4smile.com/quotes/sunday-adelaja/the-power-of-imagination-is-strongest-in-the-place-of-solitude/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

> [Create an environment for people to fail, to learn, and to grow. Their creativity and productivity will increase.](https://sms4smile.com/quotes/anonymous/create-an-environment-for-people-to-fail-to-learn-and-to-grow-their/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [Normally, it's more efficient to climb fast.](https://sms4smile.com/quotes/adam-ondra/normally-it-s-more-efficient-to-climb-fast/)

[Adam Ondra](https://sms4smile.com/quotes/author/adam-ondra/)

> [One of my most productive days was throwing away 1,000 lines of code.](https://sms4smile.com/quotes/ken-thompson/one-of-my-most-productive-days-was-throwing-away-1-000-lines-of-code/)

[Ken Thompson](https://sms4smile.com/quotes/author/ken-thompson/)

> [Focus on being productive instead of busy.](https://sms4smile.com/quotes/tim-ferriss/focus-on-being-productive-instead-of-busy/)

[Tim Ferriss](https://sms4smile.com/quotes/author/tim-ferriss/)

> [Many companies have long contended that stress in the home causes productivity loss in the market place.. and it does. But research now reveals…](https://sms4smile.com/quotes/zig-ziglar/many-companies-have-long-contended-that-stress-in-the-home-causes/)

[Zig Ziglar](https://sms4smile.com/quotes/author/zig-ziglar/)

> [To settle space, we will have to develop the ability to harvest and utilize the resources of the solar system, such as ores, ice,…](https://sms4smile.com/quotes/rick-tumlinson/to-settle-space-we-will-have-to-develop-the-ability-to-harvest-and/)

[Rick Tumlinson](https://sms4smile.com/quotes/author/rick-tumlinson/)

> [he cult of productivity has its place, but worshipping at its altar daily robs us of the very capacity for joy and wonder that…](https://sms4smile.com/quotes/maria-popova/he-cult-of-productivity-has-its-place-but-worshipping-at-its-altar/)

[Maria Popova](https://sms4smile.com/quotes/author/maria-popova/)

> [“Don’t let procrastination hold you back. Every small decision counts toward your potential. Be wise”](https://sms4smile.com/quotes/afolayan-david-ojo/don-t-let-procrastination-hold-you-back-every-small-decision-counts/)

Afolayan David Ojo

> [“You can remodel yourself to anything you want to become.”](https://sms4smile.com/quotes/sunday-adelaja/you-can-remodel-yourself-to-anything-you-want-to-become/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

> [Everyday, all day I have to be productive. And when I ain't productive, I get concerned.](https://sms4smile.com/quotes/young-jeezy/everyday-all-day-i-have-to-be-productive-and-when-i-ain-t-productive/)

[Young Jeezy](https://sms4smile.com/quotes/author/young-jeezy/)

> [As American productivity, once the exuberant engine of national wealth, has dipped to an embarrassingly uncompetitive low, Americans have shaken their heads: the country's…](https://sms4smile.com/quotes/lance-morrow/as-american-productivity-once-the-exuberant-engine-of-national-wealth/)

[Lance Morrow](https://sms4smile.com/quotes/author/lance-morrow/)

> [“To reproduce your life is to convert it into tangible products for the benefit of humanity. To reproduce your life is to impact the…](https://sms4smile.com/quotes/sunday-adelaja/to-reproduce-your-life-is-to-convert-it-into-tangible-products-for/)

[Sunday Adelaja](https://sms4smile.com/quotes/author/sunday-adelaja/)

[Browse all 3,424 Productivity quotes ](https://sms4smile.com/quotes/about/productivity/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“suppress empty strings in the output array when the separator is a regular expression: var f = '|a|b|c|'.split(/\\|/); // f is ['a', 'b', 'c'] on some systems, and // f is ['', 'a', 'b', 'c', ''] on others string.substring(start, end ) The substring method is the same as the slice method except that it doesn’t handle the adjustment for negative parameters. There is no reason to use the substring method. Use slice instead. string.toLocaleLowerCase( ) The toLocaleLowerCase method produces a new string that is made by converting this string to lowercase using the rules for the locale. This is primarily for the benefit of Turkish because in that language 'I’ converts to 1”",
            "creator": {
                "@type": "Person",
                "name": "Douglas Crockford"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/douglas-crockford/suppress-empty-strings-in-the-output-array-when-the-separator-is-a/",
            "about": {
                "@type": "Thing",
                "name": "Productivity"
            },
            "@id": "https://sms4smile.com/quotes/douglas-crockford/suppress-empty-strings-in-the-output-array-when-the-separator-is-a/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png",
                "contentUrl": "https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png",
                "url": "https://sms4smile.com/quotes/i/566/douglas-crockford-19095_productivity_suppress-empty-strings-in-the-output-arr_751466.png",
                "width": 1080,
                "height": 1080,
                "caption": "“suppress empty strings in the output array when the separator is a regular expression: var f =…” — Douglas Crockford",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Douglas Crockford",
                    "item": "https://sms4smile.com/quotes/author/douglas-crockford/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“suppress empty strings in the output...",
                    "item": "https://sms4smile.com/quotes/douglas-crockford/suppress-empty-strings-in-the-output-array-when-the-separator-is-a/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/douglas-crockford/suppress-empty-strings-in-the-output-array-when-the-separator-is-a/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
