Advertisement
RokiAdhytama

Character Processing - Chapter 12-1

Jul 4th, 2022
559
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.93 KB | None
  1.  
  2. <html xmlns = "http://www.w3.org/1999/xhtml">
  3.    <head>
  4.       <title>Character Processing Methods</title>
  5.  
  6.       <script type = "text/javascript">
  7.          <!--
  8.          var s = "ZEBRA";
  9.          var s2 = "AbCdEfG";
  10.          
  11.          document.writeln( "<p>Character at index 0 in '" +
  12.             s + "' is " + s.charAt( 0 ) );
  13.          document.writeln( "<br />Character code at index 0 in '"
  14.             + s + "' is " + s.charCodeAt( 0 ) + "</p>" );
  15.            
  16.          document.writeln( "<p>'" +
  17.             String.fromCharCode( 87, 79, 82, 68 ) +
  18.             "' contains character codes 87, 79, 82 and 68</p>" )
  19.            
  20.          document.writeln( "<p>'" + s2 + "' in lowercase is '" +
  21.             s2.toLowerCase() + "'" );      
  22.          document.writeln( "<br />'" + s2 + "' in uppercase is '"
  23.             + s2.toUpperCase() + "'</p>" );      
  24.           // -->
  25.       </script>
  26.  
  27.    </head><body></body>
  28. </html>
Advertisement
RAW Paste Data Copied
Advertisement