Hey guys I'm trying to make my first webtease but I'm encountering a problem. I have taken the name of the player with a prompt and saved it to a variable called 'name'. I want this to always have a capital first letter and the rest lowercase (because it's a name) and I've tried to do that using an eval with as seen in the picture below. When I tested it by using a say command that said : 'name2'. When I filled in jAmES (not my real name) it returned me exactly what I put in. What am I doing wrong?
Problem with the toLowerCase and toUpperCase function
Re: Problem with the toLowerCase and toUpperCase function
Okay now it just gives me the capital letter J (using James)??????
Re: Problem with the toLowerCase and toUpperCase function
fixed it :)
Ended up using the following script with a prompt saving to 'inputname'
name1 = inputname.toLowerCase();
name = name1.charAt(0).toUpperCase() + name1.slice(1);
Ended up using the following script with a prompt saving to 'inputname'
name1 = inputname.toLowerCase();
name = name1.charAt(0).toUpperCase() + name1.slice(1);
Who is online
Users browsing this forum: No registered users and 60 guests