GeeCON Prague 2014*
The moose likes Java in General and the fly likes how to replace integer in agiven string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "how to replace integer in agiven string" Watch "how to replace integer in agiven string" New topic
Author

how to replace integer in agiven string

sunil kumar singh
Greenhorn

Joined: Oct 16, 2008
Posts: 1
how to replace height="100"and width="45" in the given string below
the height and width value are not fixed in the string given below


i am getting this string in a servlet as a string from request.getparameter method

<


 

subhash uppalapati
Greenhorn

Joined: Nov 03, 2005
Posts: 17
Where is the "string given below"?
Rajeev Trikha
Ranch Hand

Joined: Jan 29, 2010
Posts: 85
Answer would make use of regex.


Rajeev Trikha (SCJP 6)
Gabriela Cristian
Greenhorn

Joined: Dec 02, 2008
Posts: 18

Hello
make use of string replace function( http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replace%28char,%20char%29
 
GeeCON Prague 2014
 
subject: how to replace integer in agiven string