Skip to content

Tag: string

Unicode normalization forms Explanation (Java)

I’m using Normalizer.normalize(url, Normalizer.Form.NFD) to avoid having characters like é in my url, and I do not understand the meaning of the Normalizer.Form consts (NFC, NFD, NFKC, and NFKD) or when to use each one. I consulted the documentation but this did not help at all. Does anyone have any ide…

Separate List in Java

I need help on separating List. I am really new to this I have a code that results to this [[a, b, c, d, e], f] setOfLetters() is from a query My question is how can I make my result like this? [a, b, c, d, e, f] Is it by using for loop? Or anything you can suggest. Thanks

problems at splitting strings in java

I’m new to java and I want to know how to splits strings with values. I had an array like this : and I want to divide each string into 3 values, the name (String) the x-value (double), and the y-value (double) firstly I thought of cutting at every space, but for the cities like San Francisco, it won&#82…

List of int array in Java

How do I print the contents of a List that contains a primitive type int object in it? Prefer answers to print this in one line. This is the code I have. This will give me [0,1] but I am looking for {[0,1],[2,3]} Answer The following one-liner can meet your requirement: It uses the positive lookbehind and pos…

Substring a string in JAVA

Is possible to substring this String = “D:/test/for test/change.txt:D:/test/for test/further.txt:D:/test/for test/yandex.txt” to: Because are two column, I can not split() use “:”. Answer A simple regular expression below splits on “:” that are followed by a “drivelet…