Вот мой код,
public static String set_x_dates()
{
int noRecords = GlobalData.getNoRecords();
int n;
String date = "";
if (noRecords <= 10)
for (n = 0; n < noRecords; n++)
date += Dates[n] + "-" + Month[n] + "|";
else {
for (n = 0; n < noRecords; n++) {
int gap = (int) (noRecords / 10);
date += Dates[n] + "-" + Month[n] + "|";
n++;
if (n != noRecords)
for (; gap > 0; gap--)
date += "|";
}
}
return date;
}
Я хочу удалить повторяющиеся записи из строки «дата», которая возвращается.Dates [] и Month [] являются статическими массивами int.Кто-нибудь может мне помочь?
Вывод, который я получаю, таков:
25-5|28-5|4-6|8-6|10-6|14-6|17-6|7-7|7-7|7-7|7-7|7-7|7-7|7-7|7-7|7-7|7-7|26-7|26-7|
и я хочу это:
25-5|28-5|4-6|8-6|10-6|14-6|17-6|7-7|26-7|