PHP – Replace last occurrence in a String

<?php function str_lreplace($search, $replace, $subject) { $pos = strrpos($subject, $search); if($pos !== false) { $subject = substr_replace($subject, $replace, $pos, strlen($search)); } return $subject; } $search = ".Maui"; $replace = "is awesome"; $subject = ".Maui .Maui";…

Replacing Newline Characters in Java and JSTL

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <% pageContext.setAttribute("newLineChar", "\n"); %> <p class="text-muted"> ${fn:replace(myText, newLineChar, "<br />")} </p>

JSTL – fn:replace() Function

<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> <%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> <html> <head> <title>Exmaple of JSTL – fn:replace() Function</title> </head> <body> <c:set var = "string1" value = ".Maui…

Holidays are over! Back to work.

After a little vacation, we got back to work. Thanks to those who have donated in these weeks and continue to support this project. Here’s the latest news: – Vulture CSS WEB Tool is now…

Download a Webpage in Java

public static String downloadFromUrl(String my_url) { URL url; InputStream is = null; BufferedReader br; String line; String content = “”; try { url = new URL(my_url); is = url.openStream(); // throws an IOException br =…