Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Codes Author
Wed, 23-Apr-2014 Authors
Zondray
40
All Time Authors
Satyapriyanayak
11600
Jayakumars
8120
Niladri.biswas
6000

Latest members | More ...


(Statistics delayed by 5 minutes)

Find particular sentinces From Pragragraph using Javscript

Sagarp
Posted by Sagarp under JavaScript on 2/10/2011 11:43:48 AM | Points: 40 | Views : 1172 | Status : [Member]

<script type="text/javascript" language="JavaScript1.1">

<!--
// Declare variables
var pos = 0;
var num = -1;
var i = -1;
var graf = "This is a test This is a test This is a test dsadasad This is a test adadasdsa This is a test fdsfdsfdsf This is a test ";

// Search the string and counts the number of e's
while (pos != -1) {
pos = graf.indexOf("This is a test", i + 1);
num += 1;
i = pos;
}

// Write the response to the page
document.write(graf+"<br>")
document.write("There were " + num + " e's in that paragraph."); document.close();
//-->
</script>


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/
Found interesting? Add this to:



Comments or Responses


Login to post response.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.