Javascript String Length Program with Algorithm and Pseudocode
Javascript String Length Program with Algorithm, Flowchart, and Pseudocode will be discussed in today’s tutorial.
Algorithm of finding the String Length
- Open HTML, head and body tags.
- Under head tag, open title tag and set the title of the program and close title tag.
- Underbody tag open script tag.
- In the script, the tag makes the object of Str.leanth() and write a string that is to be measured.
- Show output on screen close script tag.
- Close all other open tags.
Pseudo Code of finding the String Length
<html tag>
<head tag>
<title tag>JavaScript String length Property
<body tag>
<script tag>
var str = new String( “This is string that is to be measured” ); store in variable.
output show(“length of the string is:” + str.length);
Program of finding the String Length in Javascript
<html> <head> <title>JavaScript String length Property</title> </head> <body> <script> var str = new String( "This is string that is to be measured" ); document.write("length of the string is:" + str.length); </script> </body> </html>
Topic Covered
Javascript String Length Program with Algorithm and Psudocode.