- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 10:48 AM
Hello. How i change UPPER LETTER to Camel Case ?
var busca_resp = new GlideRecord('sys_user');
busca_resp.addQuery('name', "alexandre");
busca_resp.query();
if(busca_resp.next()){
gs.info("The name is : " + busca_resp.name);
gs.info("The title is : " + busca_resp.title);
}
The print is:
x_xxx_xxx_xxxxxxxx: The name is : Alexandre
x_xxx_xxx_xxxxxxxx: The title is : ANALISTA TEC
But i need: Analista Tec
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:05 AM
Idk if this is the most efficient, but seems to work
var original = "ANALISTA TEC";
var sp = original.split(' ');
var newStr = '';
for( var i=0; i<sp.length; i++){
var newStr = newStr + sp[i].charAt(0).toUpperCase() + sp[i].substr(1).toLowerCase() + " " ;
}
gs.print(newStr.trim());
*** Script: Analista Tec
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:05 AM
Idk if this is the most efficient, but seems to work
var original = "ANALISTA TEC";
var sp = original.split(' ');
var newStr = '';
for( var i=0; i<sp.length; i++){
var newStr = newStr + sp[i].charAt(0).toUpperCase() + sp[i].substr(1).toLowerCase() + " " ;
}
gs.print(newStr.trim());
*** Script: Analista Tec
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 07:38 AM
@Mike_R, its worked...... tks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 07:40 AM
Awesome, no problem!