#Quick question regarding splits
14 messages · Page 1 of 1 (latest)
lets try it
/run
import java.util.Arrays;
public class A {
public static void main(String[] args) {
System.out.println(Arrays.toString("R31".split("R")));
}
}
Here is your java(15.0.2) output @hollow bridge
[, 31]
@hollow hedge
thank you
wait so does that mean, that its the second thing? cuz I see the comma there
even though theres nothing before the comma
yeah first String is "" second String is "31"
awesome, thank you. also pretty awesome to know that there is a bot here that runs java code, thats gonna be a major help for me in the future
split is just a regex. Regex is Regular Expression. The reason it put the comma there is it split after the literal (R) that you put in the regex.
since it split at that point, one side was empty hence the random comma