# \[Extension\] Strings - Useful character collections

**URL:** <https://forum.makecode.com/t/extension-strings-useful-character-collections/22439>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [September 12, 2023, 8:43pm UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439 "2023-09-12T20:43:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [September 12, 2023, 8:43pm UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439/1 "2023-09-12T20:43:52Z")

</div>

I’ll keep this one short, because the extension I’ve made today is a very small one. Very similar and inspired by the python module with the same name, the `strings` namespace is just a collection of constants that might come in handy. **This extension is JS exclusive. If there’s demand for it, I might update it to support blocks**

* * *

# Available constants

`Digits` - this constant includes all the digits from 0-9, in string form.

```auto
strings.digits -> "0123456789"

```

`Lowercase letters` - this constant includes the english alphabet in lowercase **only**

```auto
strings.lowercase -> "abc...xyz"

```

`Uppercase letters` - this constant includes the english alphabet in uppercase **only**

```auto
strings.uppercase -> "ABC...XYZ"

```

`Special characters` - this constant includes special characters from the standard ASCII table. Only usual special characters are included, letters with motifs or rarely used/proprietary/broken symbols were omitted

```js
strings.special -> "!\"#$%&'()*+,-./:;<=>?@[\]^_{|}~`"

```

`Whitespace` - this constant includes empty or invisible characters (space & tab)

```js
strings.whitespace -> " \t" //(\t is the escape character for tab)

```

`Letters` - this constant is a combination of uppercase and lowercase letters from the english alphabet

```js
strings.letters -> "abc...xyz" + "ABC...XYZ"

```

`Alphanumeric` - this constant includes the full upper and lowercase alphabet as well as digits

```js
strings.alphanumeric -> "abc...xyz" + "ABC...XYZ" + "0...9"

```

`Ascii` - this constant includes most visible standard ascii character commonly used (upper and lowercase letters, digits and special characters)

```js
strings.ascii -> "abc...xyz" + "ABC...XYZ" + "0...9" + "!\"#$%&'()*+,-./:;<=>?@[\]^_{|}~`"

```

* * *

And, that’s the whole extension! It’s just a namespace with a bunch of exported constants I quickly put together. I mainly made it to make development easier for myself, but I decided to share it so others can use these constants in their code too!

You can import the extension from here:

> **[GitHub - sargedev/strings: A set of useful character collections. JS...](https://github.com/sargedev/strings)**
>
> A set of useful character collections. JS exclusive extension

---

<div class="post-metadata">

**Author:** ![frandev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/frandev/32/27644_2.png) [@frandev](https://forum.makecode.com/u/frandev)\
**Post date:** [September 13, 2023, 10:59pm UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439/2 "2023-09-13T22:59:08Z")

</div>

So no _ñ_?

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [September 14, 2023, 4:39pm UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439/3 "2023-09-14T16:39:49Z")

</div>

It’s supposed to be a set of constants for quick lookup like digits and letters. Special letters were not included

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [May 5, 2024, 3:38am UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439/4 "2024-05-05T03:38:47Z")

</div>

📢 Sudden revival moment!

I updated this extension to support blocks now!

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b15b21507e067cab861a882e4559cad7b349acc1.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/79f6aa9f90da6673b3d67d259cca93e6f80a459a.png)

Get the extension here:

> **[GitHub - S0m3randomguy/strings: A set of useful character collections. JS...](https://github.com/S0m3randomguy/strings)**
>
> A set of useful character collections. JS exclusive extension - S0m3randomguy/strings

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [May 14, 2024, 9:20pm UTC](https://forum.makecode.com/t/extension-strings-useful-character-collections/22439/5 "2024-05-14T21:20:32Z")

</div>

## Imporant announcement

I changed my GitHub username, so please remove this extension in any project you may have it imported, and instead import the new link under my new username (sargedev).

This is not necessary, as [the extension should still work](https://forum.makecode.com/t/how-does-makecode-handle-github-username-migrations/28716/11), but it would be the safest option. By importing the new link you will also get access to any new updates.

**WARNING: Do not import the new link before removing the old one, as this could cause conflicts**

> **[GitHub - sargedev/strings: A set of useful character collections. JS...](https://github.com/sargedev/strings)**
>
> A set of useful character collections. JS exclusive extension
