I am setting a date_string like this:
gridcell.setTag(theday + "-" + themonth + "-" + theyear + "|" + hijri_day + "-" + hijri_month + " ("+ hijri_monthno +") " + hijri_year);
And I am splitting it like this:
String date_month_year = (String) view.getTag();
String[] dateAr = date_month_year.split("-|\\||\\(|\\)|\\s+");
This is also splitting the spaces and dash in the hijri month names i.e. Rabi al-Thani or Dhul Hijjah:
private String months[] = {"Muharram","Safar","Rabi al-Awwal","Rabi al-Thani","Jumada al-Awwal","Jumada al-Thani","Rajab","Sha\'ban","Ramadhan","Shawwal","Dhul Qa\'dah","Dhul Hijjah"};
How do I split on the date_string only and not the value of the strings in the date_string?
best way is changing the date separator – to / (slash) or .(dot) If you really wanna keep like this, than after split you can check last character on string array if it is a letter join that two string into one back..
make it like this easiest way..