Fix script to fix upper case/lower case syntax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 03:12 PM
Does anyone have a fix script that can make the first letter of a string uppercase and the rest lowercase?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 03:25 PM
Could you provide details about the table involved, 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
But you will need to query the table, get the value from the required table, and then use the above code snippet to convert the string value.
Hope this helps!
Thanks,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 03:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2019 06:48 PM
Take a look at below.
https://flaviocopes.com/how-to-uppercase-first-letter-javascript/
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
