Here is my code:
Код: Выделить всё
String path = "C:\\temp\\\\7800000\7767546.pdf";
String delimeter = "\\";
String[] values = new String[3];
int counter = 0;
StringTokenizer st = new StringTokenizer(path, delimeter);
while(st.hasMoreTokens()) {
values[counter] = st.nextToken();
System.out.println(" values[counter]" + values[counter]);
++counter;
}
< /code>
Вот выход: < /p>
values[counter]C:
values[counter]temp
values[counter]7800000?67546.pdf
Подробнее здесь: https://stackoverflow.com/questions/225 ... on-in-java