question: how to clare the absolute url in a html file

D

Diez B. Roggisch

dongdong said:
is there any lib to help to clear the absolute url in a html file? for
example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
should be reserved.

Built-in string-manipulation is your friend:

"abcdef/ghi".replace("abcdef", "")


Diez
 
D

dongdong

to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the '<a href="http:.//....' tags into whitespace.
I think whether there is any lib's function to do this.
 
D

Diez B. Roggisch

dongdong said:
to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the '<a href="http:.//....' tags into whitespace.
I think whether there is any lib's function to do this.

Why do you think it is slow? It repelaces _all_ occurrences, in one sweep.
What do you expect to become faster?

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top