CAPITAL letters(upper case) change to (lower case)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-25-2022 11:00 PM
my problem is that people enter the name in full caps (ex: MICHAEL) instead of (ex: Michael)
is there a way to change all the caps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2022 12:46 AM
there are 2 string operation toLowerCase() and toUpperCase()
You can use them.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2022 01:30 AM
Hi @Mohamed Aashik ,
the field where you want to make the first letter uppercase and rest lowercase?
The basic script to do something like that is as follows:
var str = "test";
//Making sure that everything is converted to lowercase first
str = str.toLowerCase();
//Making the first character uppercase
var newStr = str.charAt(0).toUpperCase() + str.slice(1);
//result for this code -> str: test, newStr: Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2022 01:45 AM
Please try using below script
function getPropercase(str)
{
if(str)
return str.charAt(0).toUpperCase()+str.toLowerCase().substring(1);
else
return "";
}
gs.info(getPropercase("SAURABH"))
gs.info(getPropercase("saurabh"))
gs.info(getPropercase("SaUrAbh"))
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2022 03:42 AM