// making all uppercase city.toUpperCase(); //removing spaces and making all lowercase city = city.trim().toLowerCase(); //capitalizing the first letter cityCapitalized = city.charAt(0).toUpperCase() + city.slice(1);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter