- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
For this, use trim() along with replace() and toLocaleUpperCase().
Following is the code −
To run the above program, you need to use the following command −
Here, my file name is demo272.js.
This will produce the following output on console −
- How to delete records based on a word with underscore like MONTH_JAN'?
- Capitalize last letter and Lowercase first letter of a word in Java
- How to replace multiple spaces with a single space in C#?
- C# program to replace all spaces in a string with ‘%20’
- Java Program to Replace the Spaces of a String with a Specific Character
- Write a Java program to capitalize each word in the string?
- Python Program to replace a word with asterisks in a sentence
- Java Program to replace a word with asterisks in a sentence
- How to replace all occurrences of a word in a string with another word in java?