I try to edit a String input from a TextView via String.split().
The input is a String in Format dd.mm.yyyy and I want to transform it to yyyy-mm-dd I got the input from an intent, set it to the TextView. Later, without changing anything, I read the Text from the TextView and try to split it.
String date = intent.getStringExtra("date");
mDisplayDate.setText(date);
.
.
.
String userDate = mDisplayDate.getText().toString();
Log.i("TAG","userDate = "+ userDate);
String[] separated = userDate.split(".");
Log.i("TAG","Array = "+ Arrays.toString(separated));
newDate = separated[2] + "-" + separated[1] + "-" + separated[0];
Log: userDate = 30.06.2020
Log: Array = [] -> so it is a empty Array... but why?
If I seperate by e.g. a number it works... I am lost...