Compare the char value : charAt : String JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » String » charAt »

 

Compare the char value

















<HTML>
<BODY>
<SCRIPT language="JavaScript">
<!--
var the_name="abc";
first_char=the_name.charAt(0);

if (first_char=="S") {
    document.write(the_name);
else {
    document.write(first_char);
}

//-->
</SCRIPT>

</BODY>

</HTML>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo String
» charAt