[Solved] How to replace the string [closed]
I think using Regular Expression works better. private static String setSize(String htmlString) { String reg = “size=”[0-9]+””; Pattern pattern = Pattern.compile(reg); Matcher matcher = pattern.matcher(htmlString); while (matcher.find()) { String sizeString = matcher.group(); pattern = Pattern.compile(“[0-9]+”); Matcher numMatcher = pattern.matcher(sizeString); if (numMatcher.find()) { String size = numMatcher.group(); int realSize = Integer.parseInt(size); int resultSize = realSize / … Read more