
|
|
|||
Finding the Length of a String in JavaScriptBy Amrit Hallan2005-10-19
Finding length of a string in JavaScript When I used JavaScript to find the length of a string for the first time, I kept testing a function something like str.length(), whereas in JavaScript length is not a function, it is a property of the string object. So here is how you find the length of a string using length property of JavaScript:
The function alert() in this case should throw up 26. So make a mental note that to calculate the length of a string str in JavaScript, it is str.length and not str.length(). Tutorial Pages: » Finding length of a string in JavaScript |
||||
| About the NetVisits, Inc Network | Write For Us | Advertise Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy. |
Visit other NetVisits, Inc. sites: |