+ 1
Method split
String x = "programming_is_fun!_"; String[] array = x.split("_"); Why doesnt the last _ save an empty string in the array? Thanks for your help
2 Respostas
+ 3
Since last character _ is a separator and there is nothing after it, no element is created in the array. Empty string does not equal to nothingness (null). It is actually a regular string, just without any characters.
0
Thank you