DEV Community

Cover image for Stringsssssss
Sakshi
Sakshi

Posted on

1

Stringsssssss

A series of characters (letters, punctuation, etc.) is called a string.

We already know one way to store a series of things—arrays. But how can an array store characters instead of numbers?

Easy. Let's define a mapping between numbers and characters. Let's say "A" is 1 (or 0000 0001 in binary), "B" is 2 (or 0000 0010 in binary), etc. Bam. Now we have characters.

This mapping of numbers to characters is called a character encoding. One common character encoding is "ASCII".

So since we can express characters as 8-bit integers, we can express strings as arrays of 8-bit numbers characters.

Thanks for reading <3

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay