Skip to content

Tag: java

Jsoup – Remove all children from an element

I have an element as below. When I apply .empty() method on the element it is removing the text “Name”. Is there any other way to remove all child elements blindly from an element except its text ? I know the below example don’t have any child elements. Answer Try this. output:

HttpServer Request get date range from query string

I am new to Java and Vertx and I have a query string with the following format: Here I have this date_1 parameter which is within a certain range. I have been using HttpServerRequest class to extract simple parameters like integers but not sure how to proceed with these kind of range parameters. With the simp…

Why is UUID#compareTo incompatible with RFC 4122?

Overview Javas UUID class implements Comparable. But the order it implements appears to be incompatible with the specificiation given in RFC 4122. In particular, it is inconsistent with the natural order implied by its string representation (uuid1.toString().compareTo(uuid2.toString())), which lines up with t…

Netbeans Check Regular Expression

Here is an example of a very simple method. We take “foo bar”, split, replaceAll, and print. NetBeans is claiming this is a problem and giving me a warning on split and replaceAll. I can’t seem to find a way to disable this via @annotation, and information about this issue is sparse on the &…