String - A string is a sequence of characters in single quotes ('), double quotes ("), or backticks (`).
javascriptWelcome to JavaScript`;
const firstName = "Siyamala";
const lastName = 'Manikandan';
const message =
console.log(firstName);
console.log(lastName);
console.log(message);
`
OutPut
plaintext
Siyamala
Manikandan
Welcome to JavaScript
1.Length
returns the total number of characters in a string.
javascript
const language = "JavaScript";
console.log(language.length);
OutPut
plaintext
10
2.Uppercase
convert all characters to uppercase.
javascript
const text = "javascript";
console.log(text.toUpperCase());
Out
JAVASCRIPT
`markdown
**3.Lowercase
convert all characters to lowercase.
`plaintext
const text = "JAVASCRIPT";
console.log(text.toLowerCase());
`
OutPut
`markdown
javascript
`
4.Access Characters
Use the index position to access individual characters.
`plaintext
const word = "Coding";
console.log(word[0]);
console.log(word[3]);
`
OutPut
`markdown
C
i
`
5.indexOf()
returns the Character Position
`plaintext
const text = "JavaScript";
console.log(text.indexOf("S"));
`
OutPut
`markdown
4
`
6.includes()
used to check whether a specific value exists in an array
`plaintext
const course = "JavaScript Basics";
console.log(course.includes("Script"));
`
OutPut
`markdown
true
`
7.replace()
replaces the first matching value.
`plaintext
const sentence = "I love Java";
const result = sentence.replace("Java", "JavaScript");
console.log(result);
`
OutPut
`markdown
I love JavaScript
`
8.slice()
extracts a portion of a string.
`plaintext
const text = "JavaScript";
console.log(text.slice(0, 4));
`
OutPut
`markdown
Java
`
9.split()
Convert a string into an array.
`plaintext
const fruits = "Apple,Banana,Mango";
console.log(fruits.split(","));
`
OutPut
`markdown
["Apple", "Banana", "Mango"]
`
10.trim()
remove whitespace from both ends.
`plaintext
const username = " Sherin ";
console.log(username.trim());
`
OutPut
`markdown
Sherin
`
11.repeat()
repeats a string a specified number of times.
`plaintext
console.log("Hi ".repeat(3));
`
OutPut
`
Hi Hi Hi
`
Top comments (4)
Thank you so much for taking the time to read my article and leave such detailed feedback. I really appreciate it.
You're absolutely right about the formatting. I'll revisit the Markdown and improve the readability of the article.
I also like your suggestion about adding a section on string concatenation performance. That's an interesting topic, and I'll consider including it in an update or a future article.
Regarding your advice on writing about testing and automation, that's actually the direction I'm interested in. Since I'm learning Java, JavaScript, SQL, SDLC, and Automation Testing, I plan to share more testing-related content as I gain more experience. Thanks for encouraging me to focus on that niche.
😄 And thanks for the compliment about my profile picture! I'll think about the flames.
I also appreciate what you said about weaving cultural stories into technical articles. That's a unique suggestion, and I'll definitely try to make my future posts more personal and engaging.
Thanks again for your thoughtful feedback and encouragement. It means a lot, and I'll use your suggestions to improve my future articles.
Thank you for sharing that. It was genuinely interesting to read your perspective.
I think one reason many Indians don't always find these things interesting is because we grow up surrounded by them. Things like festivals, large family gatherings, temple traditions, or even long wedding ceremonies become so normal that we rarely stop to think about how unique they might seem to someone from another culture.
At the same time, India changes very quickly. It's completely normal for someone to visit an ancient temple in the morning, listen to BTS or Western music in the afternoon, and spend the evening discussing the latest technology. Most of us don't really see those things as contradictory—they're simply different parts of everyday life.
Of course, India is incredibly diverse, so everyone's experience is different. But I'm glad you found our mix of tradition and modern life interesting. Reading your observations also reminds me not to take those parts of my own culture for granted.