Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Get lenght of content within HTML

Thread view: 
davidjdoherty@gmail.com - 27 Nov 2005 18:26 GMT
Hi, I'm receiving input from my user that is HTML. I would like to find
the length of the data within the string, discounting the presentation
logic.

What I mean is that if the user types "<B>Hello</B>", I would like to
find out the length is 5 (the length of 'hello').

Anyone have any ideas of how to this?

Cheers,
David
IchBin - 27 Nov 2005 19:30 GMT
> Hi, I'm receiving input from my user that is HTML. I would like to find
> the length of the data within the string, discounting the presentation
[quoted text clipped - 7 lines]
> Cheers,
> David

This is Java group not Javascript. Two different animals. That said look
at http://javascript.about.com/od/reference/g/slength.htm

Better yet a Javascript tutorial.
http://javascript.about.com/od/reference/a/js101.htm
http://www.w3schools.com/js/default.asp
http://www.pageresource.com/jscript/index4.htm

or just google for them
Signature


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Roedy Green - 27 Nov 2005 20:38 GMT
>What I mean is that if the user types "<B>Hello</B>", I would like to
>find out the length is 5 (the length of 'hello').
>
>Anyone have any ideas of how to this?

you could use StripEntities and/or StripTags and look at the string
length.

See http://mindprod.com/products1.html#ENTITIES

site is down right now as server is being moved.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.