Experiment No. 5 Assignment On String Functions
Experiment No. 5 Assignment On String Functions
Experiment No. 5 Assignment On String Functions
5
Assignment on String Functions –
1. Develop JavaScript to accept Character from user and convert it into
Unicode. Develop JavaScript to accept Unicode from user and convert it into
character.
2. Develop JavaScript to accept character/word from user, search that
character/word in given string and print its position (Hint – search()).
3. Develop JavaScript to accept character from user and find out the last
occurrence of that character form given string.
CODE:
<!—
Aniket Gholap
30
EXP 5
-->
<!DOCTYPE html>
<html>
<head>
<title> String Functions </title>
<head>
<body>
<script>
// Develop JavaScript code to accept Character from User and
to convert it into Unicode.
var s = prompt(“Enter a Character”);
document.write(“Character Code of   <b>=” s+ </b>
 is= +s.charCodeAt()+”<br/> <br/>”);
Question 1:
Question 2:
Question 3:
----------------------------------------------------------------------------------------------------