![]() |
|
|
+ Search |
![]()
|
Jul 13th, 2000 23:45
Rory Knowles, unknown unknown, Michael S. Comperchio
Here are 3 different character counts.. <% '#1 - count total number of characters including spaces: '------------------------------------------------------- strRequest = "This is One string Number is Total of 40" response.write Len(strRequest) '------------------------------------------------------- '#2 - count number of characters without spaces: '------------------------------------------------------- strRequest = "This is One string Number is Total of 32" response.write Len(replace(strRequest, " ", "")) '------------------------------------------------------- '#3 - count number of a particular character '------------------------------------------------------- 'A Function with no loops - include in your page '------------------------------------------------------- function charcount(strRequest, char) tmp = Split(Trim(strRequest), char) charcount = UBOUND(tmp) end function '------------------------------------------------------ 'Insert This where you want to count the character '------------------------------------------------------ strRequest = "The Cat Jumped Over the Wall. The End." response.write charcount(strRequest, ".") '------------------------------------------------------ %> Hope this helps :-) Rory
© 1999-2004 Synop Pty Ltd