I am trying to write a method that replaces some Variables of a html code in a String to e.g. the source of an image etc.
String html = "<img src='IMAGE_SOURCE' width='IMAGE_WIDTH' align='IMAGE_ALIGN";
Now that's my String I've written three methods for:
public void setImageSource(String src) {
html.replace("IMAGE_SOURCE", "Here comes the source for the image");
}
public void setImageWidth(String width) {
html.replace("IMAGE_SOURCE", "Here comes the width for the image");
}
public void setImageAlign(String align) {
html.replace("IMAGE_SOURCE", "Here comes the align for the image");
}
The methods get called, but the String "html" won't change. Any suggestions?