Author name: Ravi Sharma

JavaScript String

This blog post explores JavaScript strings. We’ll look at how to make them, change them, and use some common string methods. We’ll also show code examples. 1. Making a String You can make strings with single quotes (‘) double quotes (“), or backticks (`). Example: <script> let str1 = ‘Hello’; let str2 = “World”; let …

JavaScript String Read More »

Keep Only First N Characters in a JavaScript String

For JavaScript programming, you might want to grab just a part containing the first N characters from a string. This comes in especially handy while reducing the long text in case of creating a preview or formatting user input. Here’s how one can keep only the first N characters in a JavaScript string. With code …

Keep Only First N Characters in a JavaScript String Read More »

Scroll to Top