V
V
Vyacheslav2017-01-09 22:54:53
Android
Vyacheslav, 2017-01-09 22:54:53

How to split delimited text in android?

Good afternoon.
There is a line. the enumeration is separated by spaces or a semicolon.
How to convert to a list?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav, 2017-01-09
@noxiconum

String string = ".45.79..5...78.";
String[] split = string.split("\\.");
System.out.println("g21g string [" + string+"]");
for (int i = 0; i < split.length; i++) {
    System.out.println("g21g split[i] [" + split[i]+"]");
} 

где "\\." - это разделитель, регулярное выражение

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question