- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 05:37 AM
Hi all,
I have a requirement where i get values from excel sheet and using transform map i have to load it in servicenow. Can anyone please let me know how to convert all the capitals coming to smaller case except the first letter along with spaces. Please find below the format:'
For example:
ABCD EFGH IJKL
I want the output to look like below:
Abcd Efgh Ijkl
Kindly suggest me on this.
Thanks,
Neha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 06:03 AM
Try this:
var str = 'this is a test';
var pieces = str.split(" ");
for ( var i = 0; i < pieces.length; i++ )
{
var j = pieces[i].charAt(0).toUpperCase();
pieces[i] = j + pieces[i].substr(1).toLowerCase();
}
alert(pieces.join(" "));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 06:29 AM
Cool, glad I could help