Capitalize a String
Posted by: Keith H in general, tags: apps, capitalization, JavaScript, mobile, StringSentence a String to Capital Punishment.
Even though this function and post are small, writing them from a little smart phone is "capital" punishment. After previewing my post I ending up logging into a desktop browser anyway to correct formatting which the WordPress mobile app could not handle from my script example below. Writing script from a small device is also uncomfortable. Using a tablet would be easier but does not necessarily make a lighter "sentence".
<script type="text/javascript">
var word="keith";
document.write(word);
/**
* Capitalizes the first letter of String.*
**/
function capitalize(W)
{
return W.substr(0,1).toUpperCase()+W.substr(1,W.length);
}
</script>
Entries (RSS)