DEV Community

Deeksha Sharma
Deeksha Sharma

Posted on

2 1

JavaScript String: Extract a portion of string

Alt Text

Created this comic gif to depict how substring method can be useful to extract a portion of string.

But always remember strings are immutable, so substring or any other method when applied to a string does not mutate the original string. It instead returns a new string.

Enjoy this saturday creation!

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →