P
P
Programist189462022-01-05 14:40:25
Java
Programist18946, 2022-01-05 14:40:25

What are the parameters in splte?

I solve problems on codewars, and in one solution I saw

public static String[] solution(String s) {
        s = (s.length() % 2 == 0)?s:s+"_";
        return s.split("(?<=\\G.{2})");
    }

What do the characters in split mean?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2022-01-05
@Programist18946

This is a regular expression.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question